mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-06-18 02:56:39 +00:00
Fix-up 9971145
still accessing unexisting properties
This commit is contained in:
parent
96e8b0b840
commit
3556d5ed79
@ -293,11 +293,11 @@ class TelegramBaseClient(abc.ABC):
|
|||||||
"""
|
"""
|
||||||
# All properties may be ``None`` if `__init__` fails, and this
|
# All properties may be ``None`` if `__init__` fails, and this
|
||||||
# method will be called from `__del__` which would crash then.
|
# method will be called from `__del__` which would crash then.
|
||||||
if self._sender:
|
if getattr(self, '_sender', None):
|
||||||
await self._sender.disconnect()
|
await self._sender.disconnect()
|
||||||
if self._updates_handle:
|
if getattr(self, '_updates_handle', None):
|
||||||
await self._updates_handle
|
await self._updates_handle
|
||||||
if self.session:
|
if getattr(self, 'session', None):
|
||||||
self.session.close()
|
self.session.close()
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user