Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 2 Lib/distutils/command/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def finalize_options(self):
self.build_scripts = os.path.join(self.build_base,
'scripts-%d.%d' % sys.version_info[:2])

if self.executable is None:
if self.executable is None and sys.executable:
self.executable = os.path.normpath(sys.executable)

if isinstance(self.parallel, str):
Expand Down
7 changes: 6 additions & 1 deletion 7 Lib/distutils/sysconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@
if "_PYTHON_PROJECT_BASE" in os.environ:
project_base = os.path.abspath(os.environ["_PYTHON_PROJECT_BASE"])
else:
project_base = os.path.dirname(os.path.abspath(sys.executable))
if sys.executable:
project_base = os.path.dirname(os.path.abspath(sys.executable))
else:
# sys.executable can be empty if argv[0] has been changed and Python is
# unable to retrieve the real program name
project_base = os.getcwd()


# python_build: (Boolean) if true, we're either building Python or
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Fix :mod:`distutils.sysconfig` if :data:`sys.executable` is ``None`` or an
empty string: use :func:`os.getcwd` to initialize ``project_base``. Fix
also the distutils build command: don't use :data:`sys.executable` if it is
``None`` or an empty string.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.