Skip to content

Commit

Permalink
Use __name__ instead of .split(".")[-1]
Browse files Browse the repository at this point in the history
  • Loading branch information
delivrance committed May 1, 2018
1 parent f29b8bb commit a94cf96
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyrogram/api/core/object.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@ def default(self, o: Object):
else:
return repr(o)

name = o.__class__.__name__
o = objects.get(getattr(o, "ID", None), None)

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

return r
Expand Down

0 comments on commit a94cf96

Please sign in to comment.