diff --git a/py/defs.bzl b/py/defs.bzl index 89508537..083329d5 100644 --- a/py/defs.bzl +++ b/py/defs.bzl @@ -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,