summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSajid Ali <30510036+s-sajid-ali@users.noreply.github.com>2020-01-02 15:30:11 -0600
committerTodd Gamblin <tgamblin@llnl.gov>2020-02-07 16:35:57 -0600
commit4da8f7fceff7c9f829ed99823c288abf6b81db48 (patch)
tree2dd76499d4c55b98be5cd9f9e59d4991033c862a
parent69e5683ba49d9e3c7e5f21d8cfade2d0539097cf (diff)
downloadspack-4da8f7fceff7c9f829ed99823c288abf6b81db48.tar.gz
spack-4da8f7fceff7c9f829ed99823c288abf6b81db48.tar.bz2
spack-4da8f7fceff7c9f829ed99823c288abf6b81db48.tar.xz
spack-4da8f7fceff7c9f829ed99823c288abf6b81db48.zip
RHEL8 bugfix for module_cmd (#14349)
-rw-r--r--lib/spack/spack/util/module_cmd.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/spack/spack/util/module_cmd.py b/lib/spack/spack/util/module_cmd.py
index 4ff6b0de43..d203670769 100644
--- a/lib/spack/spack/util/module_cmd.py
+++ b/lib/spack/spack/util/module_cmd.py
@@ -9,6 +9,7 @@ parsing environment modules.
"""
import subprocess
import os
+import sys
import json
import re
@@ -31,7 +32,7 @@ def module(*args):
if args[0] in module_change_commands:
# Do the module manipulation, then output the environment in JSON
# and read the JSON back in the parent process to update os.environ
- module_cmd += ' >/dev/null; python -c %s' % py_cmd
+ module_cmd += ' >/dev/null;' + sys.executable + ' -c %s' % py_cmd
module_p = subprocess.Popen(module_cmd,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,