eric6/Utilities/BackgroundService.py

changeset 7628
f904d0eef264
parent 7360
9190402e4505
child 7630
4010cc7e9c0b
diff -r 7f643d41464e -r f904d0eef264 eric6/Utilities/BackgroundService.py
--- a/eric6/Utilities/BackgroundService.py	Wed Jun 17 17:12:21 2020 +0200
+++ b/eric6/Utilities/BackgroundService.py	Wed Jun 17 20:18:54 2020 +0200
@@ -150,6 +150,7 @@
         Private method to receive the response from the clients.
         
         @param lang language of the incomming connection (str)
+        @exception RuntimeError raised if hashes don't match
         """
         connection = self.connections[lang]
         while connection.bytesAvailable():
@@ -167,8 +168,8 @@
                     connection.waitForReadyRead(50)
                 packedData += connection.read(maxSize)
 
-            assert adler32(packedData) & 0xffffffff == datahash, \
-                'Hashes not equal'
+            if adler32(packedData) & 0xffffffff != datahash:
+                raise RuntimeError('Hashes not equal')
             packedData = packedData.decode('utf-8')
             # "check" if is's a tuple of 3 values
             fx, fn, data = json.loads(packedData)

eric ide

mercurial