mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-06 10:04:51 +01:00
Fix the fix
This commit is contained in:
parent
0140b4f43b
commit
53213fb494
1 changed files with 5 additions and 2 deletions
|
|
@ -455,10 +455,13 @@ def is_usb_connected(self, devices_on_system, debug=False, only_presence=False):
|
|||
# protocol, this can only be a disconnect notification. Fall
|
||||
# through and actually try to talk to the client.
|
||||
# This will usually toss an exception if the socket is gone.
|
||||
if self._call_client('NOOP', dict())[0] is None:
|
||||
self.is_connected = False
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
if self._call_client('NOOP', dict())[0] is None:
|
||||
self.is_connected = False
|
||||
except:
|
||||
self.is_connected = False
|
||||
if not self.is_connected:
|
||||
self.device_socket.close()
|
||||
return (self.is_connected, self)
|
||||
|
|
|
|||
Loading…
Reference in a new issue