mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 05:18:10 +00:00
Fix object decoder breaking on re.Match objects
This commit is contained in:
parent
3e900214f4
commit
91ebe5f2a8
@ -16,6 +16,7 @@
|
|||||||
# You should have received a copy of the GNU Lesser General Public License
|
# You should have received a copy of the GNU Lesser General Public License
|
||||||
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import re
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from json import dumps
|
from json import dumps
|
||||||
@ -47,6 +48,9 @@ class Object(metaclass=Meta):
|
|||||||
if isinstance(obj, bytes):
|
if isinstance(obj, bytes):
|
||||||
return repr(obj)
|
return repr(obj)
|
||||||
|
|
||||||
|
if isinstance(obj, re.Match):
|
||||||
|
return repr(obj)
|
||||||
|
|
||||||
return OrderedDict(
|
return OrderedDict(
|
||||||
[("_", "pyrogram." + obj.__class__.__name__)]
|
[("_", "pyrogram." + obj.__class__.__name__)]
|
||||||
+ [
|
+ [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user