mirror of
https://github.com/davidhalter/jedi.git
synced 2026-05-26 02:08:37 +08:00
some import fixes
This commit is contained in:
+2
-2
@@ -101,8 +101,8 @@ class ImportPath(pr.Base):
|
|||||||
# 0 (0 is not a valid line number).
|
# 0 (0 is not a valid line number).
|
||||||
zero = (0, 0)
|
zero = (0, 0)
|
||||||
names = i.namespace.names[1:]
|
names = i.namespace.names[1:]
|
||||||
n = pr.Name(i.module, names, zero, zero, self.import_stmt)
|
n = pr.Name(i._sub_module, names, zero, zero, self.import_stmt)
|
||||||
new = pr.Import(i.module, zero, zero, n)
|
new = pr.Import(i._sub_module, zero, zero, n)
|
||||||
new.parent = parent
|
new.parent = parent
|
||||||
debug.dbg('Generated a nested import: %s' % new)
|
debug.dbg('Generated a nested import: %s' % new)
|
||||||
return new
|
return new
|
||||||
|
|||||||
+2
-1
@@ -314,7 +314,8 @@ def sys_path_with_modifications(module):
|
|||||||
if not isinstance(p, pr.Statement):
|
if not isinstance(p, pr.Statement):
|
||||||
continue
|
continue
|
||||||
commands = p.get_commands()
|
commands = p.get_commands()
|
||||||
assert len(commands) == 1
|
if len(commands) != 1: # sys.path command is just one thing.
|
||||||
|
continue
|
||||||
call = commands[0]
|
call = commands[0]
|
||||||
n = call.name
|
n = call.name
|
||||||
if not isinstance(n, pr.Name) or len(n.names) != 3:
|
if not isinstance(n, pr.Name) or len(n.names) != 3:
|
||||||
|
|||||||
Reference in New Issue
Block a user