Catch AttributeError in client connected check
If the client has never connected, there will be no __transport attribute.
This commit is contained in:
parent
2e2496cd4c
commit
fa454b5950
1 changed files with 6 additions and 1 deletions
|
|
@ -222,7 +222,12 @@ class SocketIO(object):
|
|||
|
||||
@property
|
||||
def connected(self):
|
||||
return self.__transport.connected
|
||||
try:
|
||||
transport = self.__transport
|
||||
except AttributeError:
|
||||
return False
|
||||
else:
|
||||
return transport.connected
|
||||
|
||||
@property
|
||||
def _transport(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue