Parcourir la source

[2617] make sure error info isn't lost on socket.error in getbytes()

the previous code (probably unintentionally) converted it to an empty
socket.error, resulting in useless debug message.
JINMEI Tatuya il y a 12 ans
Parent
commit
fe0db0adf0
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      src/bin/msgq/msgq.py.in

+ 2 - 2
src/bin/msgq/msgq.py.in

@@ -347,8 +347,8 @@ class MsgQ:
         while len(received) < length:
             try:
                 data = sock.recv(length - len(received))
-            except socket.error:
-                raise MsgQReceiveError(socket.error)
+            except socket.error as err:
+                raise MsgQReceiveError(str(err))
             if len(data) == 0:
                 raise MsgQReceiveError("EOF")
             received += data