149 "ExceptionValue": str(excval), |
150 "ExceptionValue": str(excval), |
150 "Traceback": tbinfo, |
151 "Traceback": tbinfo, |
151 }) |
152 }) |
152 |
153 |
153 # Give time to process latest response on server side |
154 # Give time to process latest response on server side |
154 try: |
155 with contextlib.suppress(socket.error, OSError): |
155 self.__connection.shutdown(socket.SHUT_RDWR) |
156 self.__connection.shutdown(socket.SHUT_RDWR) |
156 self.__connection.close() |
157 self.__connection.close() |
157 except (socket.error, OSError): |
|
158 # ignore these; socket might be closed already |
|
159 pass |
|
160 |
158 |
161 def poll(self, waitMethod=""): |
159 def poll(self, waitMethod=""): |
162 """ |
160 """ |
163 Public method to check and receive one message (if available). |
161 Public method to check and receive one message (if available). |
164 |
162 |