Skip to content

Commit 2148354

Browse files
committed
stubgen: sort import output
1 parent 7d20c07 commit 2148354

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎mypy/stubgen.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,9 +477,9 @@ def output(self) -> str:
477477
"""Return the text for the stub."""
478478
imports = ''
479479
if self._imports:
480-
imports += 'from typing import %s\n' % ", ".join(self._imports)
480+
imports += 'from typing import %s\n' % ", ".join(sorted(self._imports))
481481
if self._import_lines:
482-
imports += ''.join(self._import_lines)
482+
imports += ''.join(sorted(self._import_lines))
483483
if imports and self._output:
484484
imports += '\n'
485485
return imports + ''.join(self._output)

0 commit comments

Comments
 (0)