mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-25 09:48:36 +08:00
sorting the statements for analysis. we need to be able to reproduce results.
This commit is contained in:
@@ -588,7 +588,8 @@ class Script(object):
|
|||||||
|
|
||||||
def _analysis(self):
|
def _analysis(self):
|
||||||
statements = set(chain(*self._parser.module().used_names.values()))
|
statements = set(chain(*self._parser.module().used_names.values()))
|
||||||
for stmt in statements:
|
# Sort the statements so that the results are reproducible.
|
||||||
|
for stmt in sorted(statements, key=lambda obj: obj.start_pos):
|
||||||
if isinstance(stmt, pr.Import):
|
if isinstance(stmt, pr.Import):
|
||||||
imps = imports.ImportWrapper(self._evaluator, stmt,
|
imps = imports.ImportWrapper(self._evaluator, stmt,
|
||||||
nested_resolve=True).follow()
|
nested_resolve=True).follow()
|
||||||
|
|||||||
Reference in New Issue
Block a user