Skip to content

Commit 0a9e1aa

Browse files
authored
Apply suggestions from self code review
1 parent 1c2cb86 commit 0a9e1aa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/private/py_executable.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,9 @@ def _create_stage1_bootstrap(
786786
)
787787
template = runtime.bootstrap_template
788788
subs["%shebang%"] = runtime.stub_shebang
789-
elif main_py:
789+
elif not ctx.files.srcs:
790+
fail("mandatory 'srcs' files have not been provided")
791+
else:
790792
if (ctx.configuration.coverage_enabled and
791793
runtime and
792794
runtime.coverage_tool):
@@ -807,8 +809,6 @@ def _create_stage1_bootstrap(
807809
subs["%import_all%"] = ("True" if ctx.fragments.bazel_py.python_import_all_repositories else "False")
808810
subs["%imports%"] = ":".join(imports.to_list())
809811
subs["%main%"] = "{}/{}".format(ctx.workspace_name, main_py.short_path)
810-
else:
811-
fail("mandatory 'srcs' attribute has not been specified")
812812

813813
ctx.actions.expand_template(
814814
template = template,

0 commit comments

Comments
 (0)