mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-07 15:34:52 +00:00
Fix object decoder breaking on re.Match objects
This commit is contained in:
parent
3e900214f4
commit
91ebe5f2a8
1 changed files with 4 additions and 0 deletions
|
|
@ -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…
Reference in a new issue