mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-10 18:59:33 +00:00
Merge branch 'master' into asyncio
This commit is contained in:
@@ -129,13 +129,10 @@ class BinaryReader:
|
||||
return False
|
||||
|
||||
# If there was still no luck, give up
|
||||
self.seek(-4) # Go back
|
||||
raise TypeNotFoundError(constructor_id)
|
||||
|
||||
# Create an empty instance of the class and
|
||||
# fill it with the read attributes
|
||||
result = clazz.empty()
|
||||
result.on_response(self)
|
||||
return result
|
||||
return clazz.from_reader(self)
|
||||
|
||||
def tgread_vector(self):
|
||||
"""Reads a vector (a list) of Telegram objects"""
|
||||
|
@@ -15,7 +15,7 @@ class TcpClient:
|
||||
|
||||
if isinstance(timeout, timedelta):
|
||||
self.timeout = timeout.seconds
|
||||
elif isinstance(timeout, int) or isinstance(timeout, float):
|
||||
elif isinstance(timeout, (int, float)):
|
||||
self.timeout = float(timeout)
|
||||
else:
|
||||
raise ValueError('Invalid timeout type', type(timeout))
|
||||
|
Reference in New Issue
Block a user