Skip to content

Commit

Permalink
Fix where the error is raised, it should only be in the codepath that…
Browse files Browse the repository at this point in the history
… is used when using system python
  • Loading branch information
Caspar van Leeuwen committed Sep 5, 2024
1 parent 72c280c commit 5c4d3b6
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions easybuild/easyblocks/generic/pythonbundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,16 @@ def prepare_step(self, *args, **kwargs):

python_cmd = pick_python_cmd(req_maj_ver=req_py_majver, req_min_ver=req_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:
# 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)", req_py_majver, req_py_minver
)
else:
raise EasyBuildError("Failed to pick Python command to use")

if python_cmd:
self.all_pylibdirs = get_pylibdirs(python_cmd=python_cmd)
self.all_pylibdirs = get_pylibdirs(python_cmd=python_cmd)
self.pylibdir = self.all_pylibdirs[0]

# if 'python' is not used, we need to take that into account in the extensions filter
Expand Down

0 comments on commit 5c4d3b6

Please sign in to comment.