mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-02 11:10:18 +03:00
Fix: add destructor as the last-resort clean up
This commit is contained in:
parent
47a912150d
commit
48a1478ded
|
@ -439,6 +439,15 @@ class TelegramBaseClient(abc.ABC):
|
||||||
# A place to store if channels are a megagroup or not (see `edit_admin`)
|
# A place to store if channels are a megagroup or not (see `edit_admin`)
|
||||||
self._megagroup_cache = {}
|
self._megagroup_cache = {}
|
||||||
|
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
|
||||||
|
# Use destructor as the last-resort measure against
|
||||||
|
# unretrieved exceptions in the _sender.disconnected future
|
||||||
|
|
||||||
|
if self.disconnected:
|
||||||
|
self.disconnected.exception()
|
||||||
|
|
||||||
# endregion
|
# endregion
|
||||||
|
|
||||||
# region Properties
|
# region Properties
|
||||||
|
|
Loading…
Reference in New Issue
Block a user