diff --git a/pkgdb2client/__init__.py b/pkgdb2client/__init__.py
index 38ec417..006583d 100644
--- a/pkgdb2client/__init__.py
+++ b/pkgdb2client/__init__.py
@@ -21,7 +21,6 @@ import pkg_resources
from six.moves import input, xrange
-import fedora_cert
from fedora.client import AuthError
from fedora.client import OpenIdBaseClient
@@ -76,8 +75,9 @@ def ask_password(username=None, bad_password=False):
print("Bad password, please retry")
if not username:
try:
+ import fedora_cert
username = fedora_cert.read_user_cert()
- except fedora_cert.fedora_cert_error:
+ except Exception:
LOG.debug('Could not read Fedora cert, asking for username')
username = input("Username: ")
password = getpass.getpass("FAS password for user {0}: ".format(username))
diff --git a/pkgdb2client/utils.py b/pkgdb2client/utils.py
index 0085329..68c0b49 100644
--- a/pkgdb2client/utils.py
+++ b/pkgdb2client/utils.py
@@ -23,7 +23,6 @@ import tempfile
import datetime
import requests
-import fedora_cert
import xmlrpclib
from bugzilla import Bugzilla
@@ -32,8 +31,9 @@ from fedora.client import AccountSystem, AuthError
import pkgdb2client
try:
+ import fedora_cert
USERNAME = fedora_cert.read_user_cert()
-except fedora_cert.fedora_cert_error:
+except Exception:
pkgdb2client.LOG.debug('Could not read Fedora cert, asking for username')
USERNAME = None
diff --git a/test.py b/test.py
index 9bb86b1..b8dbad0 100644
--- a/test.py
+++ b/test.py
@@ -9,7 +9,6 @@ import uuid
from functools import wraps
from six.moves import input
-import fedora_cert
from pkgdb2client import PkgDB, PkgDBException
@@ -19,6 +18,7 @@ AUTH = True
if AUTH:
try:
+ import fedora_cert
USERNAME = fedora_cert.read_user_cert()
except:
USERNAME = input('FAS username: ')