Skip to content

Commit fe58593

Browse files
committed
make error message nicer
1 parent f028ccc commit fe58593

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

python/private/local_runtime_repo.bzl

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ a system having the necessary Python installed.
197197
""",
198198
attrs = {
199199
"interpreter_target": attr.label(
200-
doc = """
200+
doc = """
201201
A label to a Python interpreter executable.
202202
203203
*Mutually exclusive with `interpreter_path`.*
@@ -209,8 +209,8 @@ find a usable path.
209209
The {obj}`interpreter_path` attribute for getting the interpreter from
210210
a path or PATH environment lookup.
211211
:::
212-
"""
213-
),
212+
""",
213+
),
214214
"interpreter_path": attr.string(
215215
doc = """
216216
An absolute path or program name on the `PATH` env var.
@@ -294,7 +294,12 @@ def _resolve_interpreter_path(rctx):
294294
describe_failure = None
295295
else:
296296
resolved_path = None
297-
describe_failure = lambda: "Target '{}' could not be resolved to a file that exists".format(rctx.attr.interpreter_target)
297+
describe_failure = lambda: (
298+
"Target '{}' resolved to path '{}', but that file does't exist".format(
299+
rctx.attr.interpreter_taret,
300+
path,
301+
)
302+
)
298303

299304
else:
300305
interpreter_path = rctx.attr.interpreter_path or "python3"

0 commit comments

Comments
 (0)