mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 06:44:46 +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:
|
if level:
|
||||||
base = module_context.py__package__().split('.')
|
base = module_context.py__package__().split('.')
|
||||||
if base == ['']:
|
if base == [''] or base == ['__main__']:
|
||||||
base = []
|
base = []
|
||||||
if level > len(base):
|
if level > len(base):
|
||||||
path = module_context.py__file__()
|
path = module_context.py__file__()
|
||||||
|
|||||||
@@ -4,6 +4,5 @@ some_variable = 1
|
|||||||
|
|
||||||
|
|
||||||
from . import imports
|
from . import imports
|
||||||
# TODO this is not correct
|
#? int()
|
||||||
#?
|
|
||||||
imports.relative()
|
imports.relative()
|
||||||
|
|||||||
Reference in New Issue
Block a user