Skip to content

Commit

Permalink
Pull error inside block that is executed when using system python
Browse files Browse the repository at this point in the history
  • Loading branch information
Caspar van Leeuwen committed Sep 5, 2024
1 parent 4525a76 commit 9999bf1
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions easybuild/easyblocks/generic/pythonbundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,15 @@ def prepare_step(self, *args, **kwargs):
python_cmd = pick_python_cmd(req_maj_ver=req_py_majver, req_min_ver=req_py_minver,
max_py_majver=max_py_majver, max_py_minver=max_py_minver)

if python_cmd:
self.log.info("Python command being used: %s", python_cmd)
else:
if (req_py_majver is not None or req_py_minver is not None or
max_py_majver is not None or max_py_minver is not None):
# If pick_python_cmd didn't find a (system) python command, we should raise an error
if python_cmd:
self.log.info("Python command being used: %s", python_cmd)
else:
raise EasyBuildError(
"Failed to pick python command that satisfies requirements in the EasyConfigs "
"(req_py_majver = %s, req_py_minver = %s, max_py_majver = %s, max_py_minver = %s)",
req_py_majver, req_py_minver, max_py_majver, max_py_minver
)
else:
raise EasyBuildError("Failed to pick Python command to use")

self.all_pylibdirs = get_pylibdirs(python_cmd=python_cmd)
self.pylibdir = self.all_pylibdirs[0]
Expand Down

0 comments on commit 9999bf1

Please sign in to comment.