eric6/Utilities/BackgroundService.py

branch
without_py2_and_pyqt4
changeset 7192
a22eee00b052
parent 6942
2602857055c5
child 7229
53054eb5b15a
diff -r 960850ec284c -r a22eee00b052 eric6/Utilities/BackgroundService.py
--- a/eric6/Utilities/BackgroundService.py	Sat Aug 31 12:29:57 2019 +0200
+++ b/eric6/Utilities/BackgroundService.py	Sat Aug 31 12:58:11 2019 +0200
@@ -139,8 +139,7 @@
             self.__processQueue()
         else:
             packedData = json.dumps([fx, fn, data])
-            if sys.version_info[0] == 3:
-                packedData = bytes(packedData, 'utf-8')
+            packedData = bytes(packedData, 'utf-8')
             header = struct.pack(
                 b'!II', len(packedData), adler32(packedData) & 0xffffffff)
             connection.write(header)
@@ -171,8 +170,7 @@
 
             assert adler32(packedData) & 0xffffffff == datahash, \
                 'Hashes not equal'
-            if sys.version_info[0] == 3:
-                packedData = packedData.decode('utf-8')
+            packedData = packedData.decode('utf-8')
             # "check" if is's a tuple of 3 values
             fx, fn, data = json.loads(packedData)
             
@@ -385,8 +383,7 @@
         if not connection.waitForReadyRead(1000):
             return
         lang = connection.read(64)
-        if sys.version_info[0] == 3:
-            lang = lang.decode('utf-8')
+        lang = lang.decode('utf-8')
         # Avoid hanging of eric on shutdown
         if self.connections.get(lang):
             self.connections[lang].close()

eric ide

mercurial