Skip to content

Commit 68e0305

Browse files
committed
fix: use timestamp_to_datetime for state restoration
Follow-Up: d1e0f72 835bb95 e4fb530
1 parent 6883c89 commit 68e0305

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pyrogram/types/object.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def __setstate__(self, state):
106106

107107
# Maybe a better alternative would be https://docs.python.org/3/library/inspect.html#inspect.signature
108108
if isinstance(obj, tuple) and len(obj) == 2 and obj[0] == "dt":
109-
state[attr] = datetime.fromtimestamp(obj[1])
109+
state[attr] = pyrogram.utils.timestamp_to_datetime(obj[1])
110110

111111
self.__dict__ = state
112112

0 commit comments

Comments
 (0)