Skip to content

Commit 53d81f0

Browse files
committed
mypy: Ignore errors when defining stub exceptions when some modules are not available
1 parent 83876d3 commit 53d81f0

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

osc/babysitter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@
3333
from rpm import error as RPMError
3434
except:
3535
# if rpm-python isn't installed (we might be on a debian system):
36-
class RPMError(Exception):
36+
class RPMError(Exception): # type: ignore[no-redef]
3737
pass
3838

3939

4040
try:
4141
from keyring.errors import KeyringLocked
4242
except ImportError:
4343
# python-keyring is not installed
44-
class KeyringLocked(Exception):
44+
class KeyringLocked(Exception): # type: ignore[no-redef]
4545
pass
4646

4747

osc/grabber.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
try:
1414
from urllib3.exceptions import URLSchemeUnknown
1515
except ImportError:
16-
class URLSchemeUnknown(Exception):
16+
class URLSchemeUnknown(Exception): # type: ignore[no-redef]
1717
pass
1818

1919
from .core import streamfile

0 commit comments

Comments
 (0)