From a18e0242fa231a4fd29da310933c8ea5f15ba0c8 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sun, 30 Aug 2020 11:17:20 +0200 Subject: [PATCH] Fix raw API not being properly imported when using repr/eval Fixes #423 --- compiler/api/compiler.py | 2 +- pyrogram/__init__.py | 2 +- pyrogram/raw/core/tl_object.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/api/compiler.py b/compiler/api/compiler.py index 6c3dcb27..acaf9731 100644 --- a/compiler/api/compiler.py +++ b/compiler/api/compiler.py @@ -489,7 +489,7 @@ def start(format: bool = False): docstring=docstring, slots=slots, id=c.id, - qualname=f"pyrogram.raw.{c.section}.{c.qualname}", + qualname=f"{c.section}.{c.qualname}", arguments=arguments, fields=fields, read_types=read_types, diff --git a/pyrogram/__init__.py b/pyrogram/__init__.py index f967dfc5..af2c2ce9 100644 --- a/pyrogram/__init__.py +++ b/pyrogram/__init__.py @@ -33,6 +33,6 @@ class ContinuePropagation(StopAsyncIteration): pass -from . import types, filters, handlers, emoji +from . import raw, types, filters, handlers, emoji from .client import Client from .sync import idle diff --git a/pyrogram/raw/core/tl_object.py b/pyrogram/raw/core/tl_object.py index 0391ab85..48b3ec91 100644 --- a/pyrogram/raw/core/tl_object.py +++ b/pyrogram/raw/core/tl_object.py @@ -53,7 +53,7 @@ class TLObject: return dumps(self, indent=4, default=TLObject.default, ensure_ascii=False) def __repr__(self) -> str: - return "pyrogram.api.{}({})".format( + return "pyrogram.raw.{}({})".format( self.QUALNAME, ", ".join( f"{attr}={repr(getattr(self, attr))}"