Skip to content

Commit

Permalink
Merge tag 'v12.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jun 27, 2023
2 parents f857908 + 490edd8 commit cae21a3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions NEWS.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
v12.0.1
=======

Bugfixes
--------

- Fix IndexError when no parameters are supplied. (#76)


v12.0.0
=======

Expand Down
4 changes: 3 additions & 1 deletion pip_run/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def _ensure_remove_prefix(text: str, prefix: str) -> str:
return rest


@suppress(KeyError, ValueError)
@suppress(IndexError, ValueError)
def _strip_bang(params):
"""
Strip a literal `!` from the first parameter or return None.
Expand All @@ -99,6 +99,8 @@ def infer_cmd(params):
['...', 'a.py', 'param1']
>>> infer_cmd(['!an-exe', 'param1'])
['an-exe', 'param1']
>>> infer_cmd([]) == [sys.executable]
True
"""
return _strip_bang(params) or [sys.executable] + params

Expand Down

0 comments on commit cae21a3

Please sign in to comment.