From 91ebe5f2a8328d912afd50fb1a86fa99c6919482 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Wed, 8 Apr 2020 23:29:11 +0200 Subject: [PATCH] Fix object decoder breaking on re.Match objects --- pyrogram/client/types/object.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyrogram/client/types/object.py b/pyrogram/client/types/object.py index 87b32dfa..adafc8a0 100644 --- a/pyrogram/client/types/object.py +++ b/pyrogram/client/types/object.py @@ -16,6 +16,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . +import re from collections import OrderedDict from datetime import datetime from json import dumps @@ -47,6 +48,9 @@ class Object(metaclass=Meta): if isinstance(obj, bytes): return repr(obj) + if isinstance(obj, re.Match): + return repr(obj) + return OrderedDict( [("_", "pyrogram." + obj.__class__.__name__)] + [