Commit 5b8f2452 authored by Stefan Behnel's avatar Stefan Behnel

fix initial __path__ setting test in Py3

parent df316fc0
...@@ -180,6 +180,7 @@ VER_DEP_MODULES = { ...@@ -180,6 +180,7 @@ VER_DEP_MODULES = {
'run.generator_frame_cycle', # yield in try-finally 'run.generator_frame_cycle', # yield in try-finally
'run.relativeimport_T542', 'run.relativeimport_T542',
'run.relativeimport_star_T542', 'run.relativeimport_star_T542',
'run.initial_file_path', # relative import
]), ]),
(2,6) : (operator.lt, lambda x: x in ['run.print_function', (2,6) : (operator.lt, lambda x: x in ['run.print_function',
'run.cython3', 'run.cython3',
......
...@@ -17,11 +17,20 @@ setup( ...@@ -17,11 +17,20 @@ setup(
initial_path = __path__ initial_path = __path__
initial_file = __file__ initial_file = __file__
import a try:
from . import a
import_error = None
except ImportError as e:
import_error = e
import traceback
traceback.print_exc()
def test(): def test():
print "FILE: ", initial_file
print "PATH: ", initial_path
assert initial_path[0].endswith('my_test_package'), initial_path assert initial_path[0].endswith('my_test_package'), initial_path
assert initial_file.endswith('__init__.py'), initial_file assert initial_file.endswith('__init__.py'), initial_file
assert import_error is None, import_error
######## my_test_package/a.py ######## ######## my_test_package/a.py ########
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment