Skip to content

Commit e671d61

Browse files
committed
RF: use sys.executable not hardcoded "python"
this would allow to consistently use the same python (which might be python3 with python corresponding to python v 2)
1 parent 3bfd2f2 commit e671d61

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

doc/conf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from pathlib import Path
1717
from tempfile import TemporaryDirectory
1818
import shutil
19+
import sys
1920
from packaging.version import Version
2021
import nipype
2122
import subprocess as sp
@@ -54,7 +55,7 @@
5455

5556
sp.run(
5657
[
57-
"python",
58+
sys.executable,
5859
ex2rst,
5960
"--outdir",
6061
str(example_dir),
@@ -70,7 +71,7 @@
7071
)
7172
sp.run(
7273
[
73-
"python",
74+
sys.executable,
7475
ex2rst,
7576
"--outdir",
7677
str(example_dir),

tools/toollib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def sh(cmd):
3131
def compile_tree():
3232
"""Compile all Python files below current directory."""
3333
vstr = ".".join(map(str, sys.version_info[:2]))
34-
stat = os.system("python %s/lib/python%s/compileall.py ." % (sys.prefix, vstr))
34+
stat = os.system("%s %s/lib/python%s/compileall.py ." % (sys.executable, sys.prefix, vstr))
3535
if stat:
3636
msg = "*** ERROR: Some Python files in tree do NOT compile! ***\n"
3737
msg += "See messages above for the actual file that produced it.\n"

0 commit comments

Comments
 (0)