Skip to content

Commit

Permalink
Fix incorrect passing of flags to re.sub
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja authored and davidism committed Aug 17, 2023
1 parent bb6a872 commit af2da1e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Version 8.1.7

Unreleased

- Fix issue with regex flags in shell completion. :issue:`2581`


Version 8.1.6
-------------
Expand Down
2 changes: 1 addition & 1 deletion src/click/shell_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def func_name(self) -> str:
"""The name of the shell function defined by the completion
script.
"""
safe_name = re.sub(r"\W*", "", self.prog_name.replace("-", "_"), re.ASCII)
safe_name = re.sub(r"\W*", "", self.prog_name.replace("-", "_"), flags=re.ASCII)
return f"_{safe_name}_completion"

def source_vars(self) -> t.Dict[str, t.Any]:
Expand Down

0 comments on commit af2da1e

Please sign in to comment.