From 506253e506a8c22175346e92d7a017cd6118013b Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Fri, 28 Jun 2019 10:41:57 +0200 Subject: [PATCH] Fix objects failing to print in case there's no __slots__ attribute --- pyrogram/client/types/object.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrogram/client/types/object.py b/pyrogram/client/types/object.py index 4d482e63..f7fc413f 100644 --- a/pyrogram/client/types/object.py +++ b/pyrogram/client/types/object.py @@ -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 ] )