Skip to content

Commit

Permalink
pip: entry_point: Add support for exit codes
Browse files Browse the repository at this point in the history
  • Loading branch information
gibfahn committed Oct 14, 2021
1 parent 562ffc7 commit bc30a71
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/pip_install/extract_wheels/lib/bazel.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ def generate_entry_point_contents(entry_point: str, shebang: str = "#!/usr/bin/e
module, method = entry_point.split(":", 1)
return textwrap.dedent("""\
{shebang}
import sys
from {module} import {method}
if __name__ == "__main__":
from {module} import {method}
{method}()
sys.exit({method}())
""".format(
shebang=shebang,
module=module,
Expand Down

0 comments on commit bc30a71

Please sign in to comment.