Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
336d8ca7
Commit
336d8ca7
authored
Oct 22, 2018
by
Stefan Behnel
Committed by
GitHub
Oct 22, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2674 from jdemeyer/master
Fix reimport_from_subinterpreter test when PYTHONPATH is set
parents
cc02495d
d46b06fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
runtests.py
runtests.py
+4
-1
tests/run/reimport_from_subinterpreter.srctree
tests/run/reimport_from_subinterpreter.srctree
+6
-3
No files found.
runtests.py
View file @
336d8ca7
...
...
@@ -1734,7 +1734,10 @@ class EndToEndTest(unittest.TestCase):
.replace("PYTHON", sys.executable))
old_path = os.environ.get('PYTHONPATH')
env = dict(os.environ)
env['PYTHONPATH'] = self.cython_syspath + os.pathsep + (old_path or '')
new_path = self.cython_syspath
if old_path:
new_path = new_path + os.pathsep + old_path
env['PYTHONPATH'] = new_path
cmd = []
out = []
err = []
...
...
tests/run/reimport_from_subinterpreter.srctree
View file @
336d8ca7
...
...
@@ -59,11 +59,14 @@ def run_sub():
assert 0 == run_in_subinterpreter(b'1+1')
assert 0 == run_in_subinterpreter(b'2+2')
assert 0 == run_in_subinterpreter(b'import package')
assert 0 == run_in_subinterpreter(b'import package')
# The subinterpreter does not add the current working directory to
# sys.path, so we need to add it manually.
pre = b'import sys; sys.path.insert(0, "."); '
assert 0 == run_in_subinterpreter(pre + b'import package')
assert 0 == run_in_subinterpreter(pre + b'import package')
import sys
result = run_in_subinterpreter(b'import package.subtest')
result = run_in_subinterpreter(
pre +
b'import package.subtest')
if not MAIN_HAS_IMPORTED:
assert result == 0, result # imports only in subinterpreters are ok
elif sys.version_info >= (3, 5):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment