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:
parent
b6f508711a
commit
506253e506
@ -50,7 +50,7 @@ class Object(metaclass=Meta):
|
|||||||
else (attr, str(datetime.fromtimestamp(getattr(obj, attr))))
|
else (attr, str(datetime.fromtimestamp(getattr(obj, attr))))
|
||||||
if attr.endswith("date")
|
if attr.endswith("date")
|
||||||
else (attr, getattr(obj, attr))
|
else (attr, getattr(obj, attr))
|
||||||
for attr in obj.__slots__
|
for attr in getattr(obj, "__slots__", [])
|
||||||
if getattr(obj, attr) is not None
|
if getattr(obj, attr) is not None
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user