Browse Source

deploy-ng: fix some Python 3 issues in icon generation code

See #718
rdb 6 years ago
parent
commit
00376c9d0a
1 changed files with 2 additions and 2 deletions
  1. 2 2
      direct/src/p3d/DeploymentTools.py

+ 2 - 2
direct/src/p3d/DeploymentTools.py

@@ -367,7 +367,7 @@ class Icon:
         # XOR mask
         # XOR mask
         if bpp == 24:
         if bpp == 24:
             # Align rows to 4-byte boundary
             # Align rows to 4-byte boundary
-            rowalign = '\0' * (-(size * 3) & 3)
+            rowalign = b'\0' * (-(size * 3) & 3)
             for y in xrange(size):
             for y in xrange(size):
                 for x in xrange(size):
                 for x in xrange(size):
                     r, g, b = image.getXel(x, size - y - 1)
                     r, g, b = image.getXel(x, size - y - 1)
@@ -503,7 +503,7 @@ class Icon:
             if size > 256:
             if size > 256:
                 continue
                 continue
             elif size == 256:
             elif size == 256:
-                ico.write('\0\0')
+                ico.write(b'\0\0')
             else:
             else:
                 ico.write(struct.pack('<BB', size, size))
                 ico.write(struct.pack('<BB', size, size))