Skip to content

Commit 366aef9

Browse files
furtibSzelethus
andauthored
Update src/common.bzl
Co-authored-by: Kristóf Umann <dkszelethus@gmail.com>
1 parent 4c56b85 commit 366aef9

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/common.bzl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,12 @@ def python_path(ctx):
6060
python_path = py_runtime_info.interpreter
6161
elif hasattr(py_toolchain, "py3_runtime"):
6262
py_runtime = py_toolchain.py3_runtime
63-
python_path = py_runtime.interpreter_path
64-
65-
# @rules_python does not provide interpreter_path, but interpreter.path
66-
if python_path == None:
63+
if hasattr(interpreter_path, python_path):
64+
python_path = py_runtime.interpreter_path
65+
elif hasattr(interpreter.path, python_path):
6766
python_path = py_runtime.interpreter.path
67+
else:
68+
fail("Failed to retrieve python path!")
6869
else:
6970
fail("The resolved Python toolchain does not provide a Python3 runtime.")
7071
if not python_path:

0 commit comments

Comments
 (0)