Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e58d91c8
Commit
e58d91c8
authored
Mar 11, 2010
by
Florent Xicluna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the test_subprocess failure when sys.executable is meaningless: '' or a directory.
It does not fix #7774.
parent
85677617
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
Lib/sysconfig.py
Lib/sysconfig.py
+3
-2
Lib/test/test_subprocess.py
Lib/test/test_subprocess.py
+1
-1
No files found.
Lib/sysconfig.py
View file @
e58d91c8
...
...
@@ -84,7 +84,8 @@ _PREFIX = os.path.normpath(sys.prefix)
_EXEC_PREFIX
=
os
.
path
.
normpath
(
sys
.
exec_prefix
)
_CONFIG_VARS
=
None
_USER_BASE
=
None
_PROJECT_BASE
=
os
.
path
.
dirname
(
realpath
(
sys
.
executable
))
# Note: sys.executable can be '' or even a directory, until #7774 is fixed.
_PROJECT_BASE
=
realpath
(
os
.
path
.
dirname
(
sys
.
executable
))
if
os
.
name
==
"nt"
and
"pcbuild"
in
_PROJECT_BASE
[
-
8
:].
lower
():
_PROJECT_BASE
=
realpath
(
os
.
path
.
join
(
_PROJECT_BASE
,
pardir
))
...
...
@@ -294,7 +295,7 @@ def _init_non_posix(vars):
vars['SO'] = '.pyd'
vars['EXE'] = '.exe'
vars['VERSION'] = _PY_VERSION_SHORT_NO_DOT
vars['BINDIR'] =
os.path.dirname(realpath
(sys.executable))
vars['BINDIR'] =
realpath(os.path.dirname
(sys.executable))
#
# public APIs
...
...
Lib/test/test_subprocess.py
View file @
e58d91c8
...
...
@@ -135,7 +135,7 @@ class ProcessTestCase(unittest.TestCase):
self
.
assertEqual
(
p
.
stderr
,
None
)
def
test_executable_with_cwd
(
self
):
python_dir
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
sys
.
executable
))
python_dir
=
os
.
path
.
realpath
(
os
.
path
.
dirname
(
sys
.
executable
))
p
=
subprocess
.
Popen
([
"somethingyoudonthave"
,
"-c"
,
"import sys; sys.exit(47)"
],
executable
=
sys
.
executable
,
cwd
=
python_dir
)
...
...
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