mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-13 04:56:35 +03:00
Be deterministic when generating TLObjects
This commit is contained in:
parent
1b6b4a57d9
commit
08f8aa3c52
|
@ -77,9 +77,9 @@ def _write_modules(
|
||||||
# Add the relative imports to the namespaces,
|
# Add the relative imports to the namespaces,
|
||||||
# unless we already are in a namespace.
|
# unless we already are in a namespace.
|
||||||
if not ns:
|
if not ns:
|
||||||
builder.writeln('from . import {}', ', '.join(
|
builder.writeln('from . import {}', ', '.join(sorted(
|
||||||
x for x in namespace_tlobjects.keys() if x
|
x for x in namespace_tlobjects.keys() if x
|
||||||
))
|
)))
|
||||||
|
|
||||||
# Import 'os' for those needing access to 'os.urandom()'
|
# Import 'os' for those needing access to 'os.urandom()'
|
||||||
# Currently only 'random_id' needs 'os' to be imported,
|
# Currently only 'random_id' needs 'os' to be imported,
|
||||||
|
@ -147,7 +147,7 @@ def _write_modules(
|
||||||
builder.writeln('if TYPE_CHECKING:')
|
builder.writeln('if TYPE_CHECKING:')
|
||||||
for namespace, names in imports.items():
|
for namespace, names in imports.items():
|
||||||
builder.writeln('from {} import {}',
|
builder.writeln('from {} import {}',
|
||||||
namespace, ', '.join(names))
|
namespace, ', '.join(sorted(names)))
|
||||||
|
|
||||||
builder.end_block()
|
builder.end_block()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user