Skip to content

Commit

Permalink
Merge pull request Nitrokey#158 from Nitrokey/mypy-re-pattern
Browse files Browse the repository at this point in the history
Fix type annotation for re.Pattern
  • Loading branch information
szszszsz authored Jan 20, 2022
2 parents 5045db4 + 05694d4 commit 9f3b9f1
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pynitrokey/updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
# copied, modified, or distributed except according to those terms.

import os.path
import re
import urllib.parse
from typing import BinaryIO, Callable, Dict, Generator, Optional
from typing import BinaryIO, Callable, Dict, Generator, Optional, Pattern

import requests

Expand Down Expand Up @@ -81,12 +80,12 @@ def __str__(self) -> str:
return self.tag

@classmethod
def _from_release(cls, release: dict, url_pattern: re.Pattern) -> "FirmwareUpdate":
def _from_release(cls, release: dict, url_pattern: Pattern) -> "FirmwareUpdate":
return cls._from_assets(release["assets"], release["tag_name"], url_pattern)

@classmethod
def _from_assets(
cls, assets: list, tag: str, url_pattern: re.Pattern
cls, assets: list, tag: str, url_pattern: Pattern
) -> "FirmwareUpdate":
urls = []
for asset in assets:
Expand All @@ -103,7 +102,7 @@ def _from_assets(


class Repository:
def __init__(self, owner: str, name: str, update_pattern: re.Pattern) -> None:
def __init__(self, owner: str, name: str, update_pattern: Pattern) -> None:
self.owner = owner
self.name = name
self.update_pattern = update_pattern
Expand Down

0 comments on commit 9f3b9f1

Please sign in to comment.