File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -369,7 +369,10 @@ def disconnect(self):
369369 All pending and future calls will error with a connection error.
370370 """
371371 self ._user_disconnect = True
372- self ._sock .shutdown (socket .SHUT_RDWR )
372+ try :
373+ self ._sock .shutdown (socket .SHUT_RDWR )
374+ except Exception :
375+ logging .warning ('could not shut down socket' , exc_info = True )
373376
374377 def next_serial (self ) -> int :
375378 """Get the next serial for this bus. This can be used as the ``serial``
@@ -435,7 +438,10 @@ def _finalize(self, err):
435438 self ._disconnected = True
436439
437440 for handler in self ._method_return_handlers .values ():
438- handler (None , err )
441+ try :
442+ handler (None , err )
443+ except Exception :
444+ logging .warning ('a message handler threw an exception on shutdown' , exc_info = True )
439445
440446 self ._method_return_handlers .clear ()
441447
You can’t perform that action at this time.
0 commit comments