Skip to content

Commit

Permalink
Fix buggy regex (make the prefix optional).
Browse files Browse the repository at this point in the history
  • Loading branch information
ionelmc committed Mar 22, 2021
1 parent 14e907c commit 74a0fa5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/manhole/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
SIG_NUMBERS.add(num)


def parse_pid(value, regex=re.compile(r'^.+(/manhole-)?(?P<pid>\d+)$')):
def parse_pid(value, regex=re.compile(r'^(.*/manhole-)?(?P<pid>\d+)$')):
match = regex.match(value)
if not match:
raise argparse.ArgumentTypeError("PID must be in one of these forms: 1234 or /tmp/manhole-1234")
Expand Down

0 comments on commit 74a0fa5

Please sign in to comment.