1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-24 22:06:14 +01:00

osc can crash due to various exceptions when loading

key management.

Not sure if this is the best way, but make osc usable at all again...
This commit is contained in:
Adrian Schröter 2020-02-24 11:26:49 +01:00 committed by Daniel Mach
parent 80c9b6e3df
commit 7370b23822

View File

@ -2,18 +2,32 @@ import importlib
import bz2
import base64
import getpass
import sys
try:
from urllib.parse import urlsplit
except ImportError:
from urlparse import urlsplit
try:
import keyring
except ImportError:
keyring = None
except BaseException as e:
# catch and report any exceptions raised in the 'keyring' module
msg = "Warning: Unable to load the 'keyring' module due to an internal error:"
print(msg, e, file=sys.stderr)
keyring = None
try:
import gnomekeyring
except ImportError:
gnomekeyring = None
except BaseException as e:
# catch and report any exceptions raised in the 'gnomekeyring' module
msg = "Warning: Unable to load the 'gnomekeyring' module due to an internal error:"
print(msg, e, file=sys.stderr)
gnomekeyring = None
class AbstractCredentialsManagerDescriptor(object):