Skip to content

Commit

Permalink
Merge pull request #53 from albertwujj/master
Browse files Browse the repository at this point in the history
Use current python interpreter in subprocesses
  • Loading branch information
jachiam authored Nov 24, 2018
2 parents cd7dbce + 948548f commit 52e7ec3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion spinup/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def process(arg):
elif cmd in valid_utils:
# Execute the correct utility file.
runfile = osp.join(osp.abspath(osp.dirname(__file__)), 'utils', cmd +'.py')
args = ['python', runfile] + sys.argv[2:]
args = [sys.executable if sys.executable else 'python', runfile] + sys.argv[2:]
subprocess.check_call(args, env=os.environ)
else:
# Assume that the user plans to execute an algorithm. Run custom
Expand Down
4 changes: 2 additions & 2 deletions spinup/utils/run_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def thunk_plus():
encoded_thunk = base64.b64encode(zlib.compress(pickled_thunk)).decode('utf-8')

entrypoint = osp.join(osp.abspath(osp.dirname(__file__)),'run_entrypoint.py')
cmd = ['python', entrypoint, encoded_thunk]
cmd = [sys.executable if sys.executable else 'python', entrypoint, encoded_thunk]
try:
subprocess.check_call(cmd, env=os.environ)
except CalledProcessError:
Expand Down Expand Up @@ -554,4 +554,4 @@ def test_eg():
eg.add('why', [True,False])
eg.add('huh', 5)
eg.add('no', 6, in_name=True)
return eg.variants()
return eg.variants()
2 changes: 1 addition & 1 deletion spinup/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version_info = (0, 1, 1)
version_info = (0, 1, 2)
# format:
# ('spinup_major', 'spinup_minor', 'spinup_patch')

Expand Down

0 comments on commit 52e7ec3

Please sign in to comment.