More consistent with asyncio branch (style/small fixes)

Like passing an extra (invalid) dt parameter when serializing
a datetime, and handling more errors in the TcpClient class.
This commit is contained in:
Lonami Exo
2018-01-05 18:31:48 +01:00
parent c4e26c95f5
commit ec4ca5dbfc
4 changed files with 22 additions and 25 deletions

View File

@@ -192,10 +192,10 @@ def get_inner_text(text, entity):
:param entity: the entity or entities that must be matched.
:return: a single result or a list of the text surrounded by the entities.
"""
if not isinstance(entity, TLObject) and hasattr(entity, '__iter__'):
if isinstance(entity, TLObject):
entity = (entity,)
multiple = True
else:
entity = [entity]
multiple = False
text = text.encode(ENC)