mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-03 22:14:50 +00:00
Fix objects failing to print in case there's no __slots__ attribute
This commit is contained in:
parent
b6f508711a
commit
506253e506
1 changed files with 1 additions and 1 deletions
|
|
@ -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…
Reference in a new issue