Visitar URL original
Use __name__ instead of .split(".")[-1] · fourstring/pyrogram@3d3c1e2 · GitHub
Skip to content

Commit 3d3c1e2

Browse files
committed
Use __name__ instead of .split(".")[-1]
1 parent f29b8bb commit 3d3c1e2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎pyrogram/api/core/object.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,12 @@ def default(self, o: Object):
7272
else:
7373
return repr(o)
7474

75+
name = o.__class__.__name__
7576
o = objects.get(getattr(o, "ID", None), None)
7677

7778
if o is not None:
7879
if o.startswith("pyrogram.client"):
79-
r = remove_none(OrderedDict([("_", o.split(".")[-1])] + [i for i in content.items()]))
80+
r = remove_none(OrderedDict([("_", name)] + [i for i in content.items()]))
8081
r.pop("client", None)
8182

8283
return r

0 commit comments

Comments
 (0)