Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed a problem with positions of modules/imports

  • Loading branch information...
commit 7fda97767e94ca27d5b8e083013c04f3fa805b8b 1 parent 80ec5e0
@davidhalter authored
Showing with 4 additions and 1 deletion.
  1. +1 −1  jedi/evaluate.py
  2. +3 −0  test/regression.py
View
2  jedi/evaluate.py
@@ -1193,7 +1193,7 @@ def descriptor_check(result):
if isinstance(scope, Instance):
scope_generator = scope.scope_generator()
else:
- if isinstance(scope, Class):
+ if isinstance(scope, (Class, parsing.Module)):
# classes are only available directly via chaining?
# strange stuff...
names = scope.get_defined_names()
View
3  test/regression.py
@@ -158,6 +158,9 @@ def check(call_def, name, index):
assert check(self.get_in_function_call(s8), 'zip', 0)
assert check(self.get_in_function_call(s8, (1, 8)), 'str', 0)
+ s = "import time; abc = time; abc.sleep("
+ assert check(self.get_in_function_call(s), 'sleep', 0)
+
def test_add_dynamic_mods(self):
api.settings.additional_dynamic_modules = ['dynamic.py']
# Fictional module that defines a function.
Please sign in to comment.
Something went wrong with that request. Please try again.