2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-29 05:18:10 +00:00

Fix objects failing to print in case there's no __slots__ attribute

This commit is contained in:
Dan 2019-06-28 10:41:57 +02:00
parent b6f508711a
commit 506253e506

View File

@ -50,7 +50,7 @@ class Object(metaclass=Meta):
else (attr, str(datetime.fromtimestamp(getattr(obj, attr))))
if attr.endswith("date")
else (attr, getattr(obj, attr))
for attr in obj.__slots__
for attr in getattr(obj, "__slots__", [])
if getattr(obj, attr) is not None
]
)