From 08f8aa3c526c043c107ec1b489b89c011555722f Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Wed, 24 Apr 2019 09:40:17 +0200 Subject: [PATCH] Be deterministic when generating TLObjects --- telethon_generator/generators/tlobject.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/telethon_generator/generators/tlobject.py b/telethon_generator/generators/tlobject.py index 647da1a9..64ac3b54 100644 --- a/telethon_generator/generators/tlobject.py +++ b/telethon_generator/generators/tlobject.py @@ -77,9 +77,9 @@ def _write_modules( # Add the relative imports to the namespaces, # unless we already are in a namespace. if not ns: - builder.writeln('from . import {}', ', '.join( + builder.writeln('from . import {}', ', '.join(sorted( x for x in namespace_tlobjects.keys() if x - )) + ))) # Import 'os' for those needing access to 'os.urandom()' # Currently only 'random_id' needs 'os' to be imported, @@ -147,7 +147,7 @@ def _write_modules( builder.writeln('if TYPE_CHECKING:') for namespace, names in imports.items(): builder.writeln('from {} import {}', - namespace, ', '.join(names)) + namespace, ', '.join(sorted(names))) builder.end_block()