From 53d81f0712714e9e7442495dc35b5a930cbf331c Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Wed, 11 Oct 2023 10:40:02 +0200 Subject: [PATCH] mypy: Ignore errors when defining stub exceptions when some modules are not available --- osc/babysitter.py | 4 ++-- osc/grabber.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osc/babysitter.py b/osc/babysitter.py index c4faed285e..5357dc9c9f 100644 --- a/osc/babysitter.py +++ b/osc/babysitter.py @@ -33,7 +33,7 @@ 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] pass @@ -41,7 +41,7 @@ class RPMError(Exception): from keyring.errors import KeyringLocked except ImportError: # python-keyring is not installed - class KeyringLocked(Exception): + class KeyringLocked(Exception): # type: ignore[no-redef] pass diff --git a/osc/grabber.py b/osc/grabber.py index 692443aeb2..3dd7031ea4 100644 --- a/osc/grabber.py +++ b/osc/grabber.py @@ -13,7 +13,7 @@ try: from urllib3.exceptions import URLSchemeUnknown except ImportError: - class URLSchemeUnknown(Exception): + class URLSchemeUnknown(Exception): # type: ignore[no-redef] pass from .core import streamfile