From 9c32edfdd54e0ad22fed09c33262f5963accfaf6 Mon Sep 17 00:00:00 2001 From: Diego Roversi Date: Sun, 3 May 2020 11:57:32 +0200 Subject: display: more conversion from string to bytearray --- display/pythonxlibintf.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'display/pythonxlibintf.py') diff --git a/display/pythonxlibintf.py b/display/pythonxlibintf.py index 04d85bb..846be78 100644 --- a/display/pythonxlibintf.py +++ b/display/pythonxlibintf.py @@ -44,8 +44,8 @@ class Display: self.motionev = None self.dpy.flush() - pixel = "\x00\x00\x80" - hole = "\x01\x01\x01" + pixel = b"\x00\x00\x80" + hole = b"\x01\x01\x01" self.taskbkgnd = self.pixmap(32, 32, ((pixel+hole)*16 + (hole+pixel)*16) * 16, 0x010101) @@ -97,14 +97,14 @@ class Display: maskdata.append(long2string(maskline, scanline)) plane /= 2 - imgdata = ''.join(imgdata) + imgdata = b''.join(imgdata) if colorkey >= 0: - maskdata = ''.join(maskdata) + maskdata = b''.join(maskdata) mask = self.win.create_pixmap(w, h, depth) mask.put_image(self.gc, 0, 0, w, h, X.XYPixmap, depth, 0, maskdata) else: mask = None - imgdata = ''.join(imgdata) + imgdata = b''.join(imgdata) image = self.win.create_pixmap(w, h, depth) image.put_image(self.gc, 0, 0, w, h, X.XYPixmap, depth, 0, imgdata) image.mask = mask @@ -201,4 +201,4 @@ class Display: def long2string(bits, strlen): - return ''.join([chr((bits>>n)&0xFF) for n in range(0, 8*strlen, 8)]) + return b''.join([chr((bits>>n)&0xFF) for n in range(0, 8*strlen, 8)]) -- cgit v1.2.3