Conditional teardown only if correctly initialised
This commit is contained in:
parent
8dff69813e
commit
059d350e9e
1
mostr.py
1
mostr.py
|
@ -120,6 +120,7 @@ class MostrHandler:
|
||||||
bot_handler.react(message, 'check')
|
bot_handler.react(message, 'check')
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
|
if hasattr(self, 'relays'):
|
||||||
self.relays.close_connections()
|
self.relays.close_connections()
|
||||||
print('Terminated Mostr Bot')
|
print('Terminated Mostr Bot')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue