Skip to content

Commit

Permalink
fix: allow main is None
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeagle committed Oct 3, 2024
1 parent b6c9cb8 commit 5f9a6b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions py/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ py_unpacked_wheel = _py_unpacked_wheel
resolutions = _resolutions

def _py_binary_or_test(name, rule, srcs, main, deps = [], resolutions = {}, **kwargs):
if type(main) not in ["string", "Label"]:
if main and type(main) not in ["string", "Label"]:
fail("main must be a Label or a string, not {}".format(type(main)))

# Compatibility with rules_python, see docs in py_executable.bzl
main_target = "_{}.find_main".format(name)
if type(main) == "string":
if type(main) != "Label":
determine_main(
name = main_target,
target_name = name,
Expand Down

0 comments on commit 5f9a6b4

Please sign in to comment.