mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-01 05:04:51 +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
|
||||
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
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__)]
|
||||
+ [
|
||||
|
|
|
|||
Loading…
Reference in a new issue