mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Relative imports should be working again even when used in more special occasions. Fixes #973
There are more fixes needed. Some things are just very unclean and might lead to further bugs.
This commit is contained in:
@@ -213,7 +213,7 @@ class Importer(object):
|
||||
|
||||
if level:
|
||||
base = module_context.py__package__().split('.')
|
||||
if base == ['']:
|
||||
if base == [''] or base == ['__main__']:
|
||||
base = []
|
||||
if level > len(base):
|
||||
path = module_context.py__file__()
|
||||
|
||||
@@ -4,6 +4,5 @@ some_variable = 1
|
||||
|
||||
|
||||
from . import imports
|
||||
# TODO this is not correct
|
||||
#?
|
||||
#? int()
|
||||
imports.relative()
|
||||
|
||||
Reference in New Issue
Block a user