mirror of
https://github.com/davidhalter/jedi.git
synced 2026-10-29 02:53:19 +08:00
sorting the statements for analysis. we need to be able to reproduce results.
This commit is contained in:
1 parent
876942d2b8
commit
7632a7d120
1 file changed
+2
-1
@@ -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