Skip to content

Commit e6cd90b

Browse files
committed
No need to modify 'python' when creating a source distribution (ref #208)
1 parent ac52942 commit e6cd90b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

setup.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -225,12 +225,14 @@ def requirements_check():
225225

226226
# Since arbitrary python can be used even within the Makefile
227227
# make sure that the current python executable is the same as the
228-
# one specified in common.mk. Easiest way is to replace
229-
this_python = sys.executable
230-
key = "PYTHON"
231-
replacement = '\n{0}:={1}'.format(key, this_python)
232-
common = replace_first_key_in_makefile(common, key, replacement,
233-
common_mk_file)
228+
# one specified in common.mk. Easiest way is to replace,
229+
# but no need to do so if creating a source distribution
230+
if 'sdist' not in sys.argv:
231+
this_python = sys.executable
232+
key = "PYTHON"
233+
replacement = '\n{0}:={1}'.format(key, this_python)
234+
common = replace_first_key_in_makefile(common, key, replacement,
235+
common_mk_file)
234236

235237
# Check if CC is in argv:
236238
CC = "CC"

0 commit comments

Comments
 (0)