From 2f28050cace33ca983554d08919e1879f9f1cb25 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Thu, 26 Oct 2017 11:54:40 +0200 Subject: [PATCH] Fix generated __bytes__ failing with flag indicator but no flags Likely since the code was ported to get rid of the BinaryWriter, since the flag calculation was inlined. Some types (only channelMessages as of layer 71) had a flag indicator but no flag arguments, so the calculation of which were not None failed. This special case is now handled correctly. --- telethon_generator/tl_generator.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/telethon_generator/tl_generator.py b/telethon_generator/tl_generator.py index b5d43656..60f07bd6 100644 --- a/telethon_generator/tl_generator.py +++ b/telethon_generator/tl_generator.py @@ -491,11 +491,15 @@ class TLGenerator: elif arg.flag_indicator: # Calculate the flags with those items which are not None - builder.write("struct.pack('