Skip to content

Commit

Permalink
refactor: fix type hint of function's return value
Browse files Browse the repository at this point in the history
Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
  • Loading branch information
davidculley and dae committed Aug 17, 2024
1 parent 7f98c0b commit 2017bb8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pylib/anki/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,9 @@ def join(self, tags: list[str]) -> str:
def rem_from_str(self, deltags: str, tags: str) -> str:
"Delete tags if they exist."

def wildcard(pat: str, repl: str) -> Match:
def wildcard(pat: str, repl: str) -> Match | None:
pat = re.escape(pat).replace("\\*", ".*")
return_value = re.match(f"^{pat}$", repl, re.IGNORECASE)
assert return_value is not None
return return_value
return re.match(f"^{pat}$", repl, re.IGNORECASE)

current_tags = self.split(tags)
for del_tag in self.split(deltags):
Expand Down

0 comments on commit 2017bb8

Please sign in to comment.