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:
Dave Halter
2018-02-15 14:10:01 +01:00
parent 276f2d0b52
commit 76df356628
2 changed files with 2 additions and 3 deletions

View File

@@ -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__()

View File

@@ -4,6 +4,5 @@ some_variable = 1
from . import imports
# TODO this is not correct
#?
#? int()
imports.relative()