mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-13 04:56:35 +03:00
Fix assert condition on generated code with flags involved
The specific case was SendMessageRequest with InputMessageEntityMentionName, failing with bot/bot_info
This commit is contained in:
parent
e349910eb9
commit
f49208f961
|
@ -314,11 +314,11 @@ class TLGenerator:
|
||||||
|
|
||||||
for ra in repeated_args.values():
|
for ra in repeated_args.values():
|
||||||
if len(ra) > 1:
|
if len(ra) > 1:
|
||||||
cnd1 = ('self.{} is None'.format(a.name) for a in ra)
|
cnd1 = ('self.{}'.format(a.name) for a in ra)
|
||||||
cnd2 = ('self.{} is not None'.format(a.name) for a in ra)
|
cnd2 = ('not self.{}'.format(a.name) for a in ra)
|
||||||
builder.writeln(
|
builder.writeln(
|
||||||
"assert ({}) or ({}), '{} parameters must all "
|
"assert ({}) or ({}), '{} parameters must all "
|
||||||
"be None or neither be None'".format(
|
"be False-y (like None) or all me True-y''".format(
|
||||||
' and '.join(cnd1), ' and '.join(cnd2),
|
' and '.join(cnd1), ' and '.join(cnd2),
|
||||||
', '.join(a.name for a in ra)
|
', '.join(a.name for a in ra)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user