defensive if's -> assert
This commit is contained in:
parent
dfd3bdd1a1
commit
0ce08b66cf
|
@ -52,7 +52,7 @@ class TransitConnection(LineReceiver):
|
|||
"""
|
||||
ITransitClient API
|
||||
"""
|
||||
if self._buddy is not None:
|
||||
assert self._buddy is not None, "internal error: no buddy"
|
||||
if self.factory.log_requests:
|
||||
log.msg("buddy_disconnected {}".format(self._buddy.get_token()))
|
||||
self._buddy._client.disconnect()
|
||||
|
@ -203,7 +203,7 @@ class WebSocketTransitConnection(WebSocketServerProtocol):
|
|||
"""
|
||||
ITransitClient API
|
||||
"""
|
||||
if self._buddy is not None:
|
||||
assert self._buddy is not None, "internal error: no buddy"
|
||||
if self.factory.log_requests:
|
||||
log.msg("buddy_disconnected {}".format(self._buddy.get_token()))
|
||||
self._buddy._client.disconnect()
|
||||
|
|
Loading…
Reference in New Issue
Block a user