Skip to content

Commit

Permalink
mypy: Ignore errors when defining stub exceptions when some modules a…
Browse files Browse the repository at this point in the history
…re not available
  • Loading branch information
dmach committed Oct 11, 2023
1 parent 83876d3 commit 53d81f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions osc/babysitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
from rpm import error as RPMError
except:
# if rpm-python isn't installed (we might be on a debian system):
class RPMError(Exception):
class RPMError(Exception): # type: ignore[no-redef]

Check warning on line 36 in osc/babysitter.py

View check run for this annotation

Codecov / codecov/patch

osc/babysitter.py#L36

Added line #L36 was not covered by tests
pass


try:
from keyring.errors import KeyringLocked
except ImportError:
# python-keyring is not installed
class KeyringLocked(Exception):
class KeyringLocked(Exception): # type: ignore[no-redef]

Check warning on line 44 in osc/babysitter.py

View check run for this annotation

Codecov / codecov/patch

osc/babysitter.py#L44

Added line #L44 was not covered by tests
pass


Expand Down
2 changes: 1 addition & 1 deletion osc/grabber.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
try:
from urllib3.exceptions import URLSchemeUnknown
except ImportError:
class URLSchemeUnknown(Exception):
class URLSchemeUnknown(Exception): # type: ignore[no-redef]

Check warning on line 16 in osc/grabber.py

View check run for this annotation

Codecov / codecov/patch

osc/grabber.py#L16

Added line #L16 was not covered by tests
pass

from .core import streamfile
Expand Down

0 comments on commit 53d81f0

Please sign in to comment.