Skip to content

Commit 3cbffd9

Browse files
committed
Revert "Log unknown constructors"
This reverts commit 0b6b598 This fixes #128
1 parent 9023d99 commit 3cbffd9

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

pyrogram/api/core/object.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,20 @@
1616
# You should have received a copy of the GNU Lesser General Public License
1717
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
1818

19-
import logging
2019
from collections import OrderedDict
2120
from datetime import datetime
2221
from io import BytesIO
2322
from json import JSONEncoder, dumps
2423

2524
from ..all import objects
2625

27-
log = logging.getLogger(__name__)
28-
2926

3027
class Object:
3128
all = {}
3229

3330
@staticmethod
3431
def read(b: BytesIO, *args):
35-
constructor_id = int.from_bytes(b.read(4), "little")
36-
37-
try:
38-
return Object.all[constructor_id].read(b, *args)
39-
except KeyError:
40-
log.error("Unknown constructor found: {}. Full data: {}".format(
41-
hex(constructor_id),
42-
b.getvalue().hex())
43-
)
32+
return Object.all[int.from_bytes(b.read(4), "little")].read(b, *args)
4433

4534
def write(self, *args) -> bytes:
4635
pass

0 commit comments

Comments
 (0)