summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pgcli/auth.py2
-rw-r--r--pgcli/main.py5
-rw-r--r--tests/features/steps/wrappers.py5
3 files changed, 3 insertions, 9 deletions
diff --git a/pgcli/auth.py b/pgcli/auth.py
index 342c4127..3d2fbeb9 100644
--- a/pgcli/auth.py
+++ b/pgcli/auth.py
@@ -26,7 +26,7 @@ def keyring_initialize(keyring_enabled, *, logger):
try:
keyring = importlib.import_module("keyring")
- except Exception as e: # ImportError for Python 2, ModuleNotFoundError for Python 3
+ except ModuleNotFoundError as e:
logger.warning("import keyring failed: %r.", e)
diff --git a/pgcli/main.py b/pgcli/main.py
index 5a263f56..cb8d4c1e 100644
--- a/pgcli/main.py
+++ b/pgcli/main.py
@@ -70,10 +70,7 @@ from .__init__ import __version__
click.disable_unicode_literals_warning = True
-try:
- from urlparse import urlparse
-except ImportError:
- from urllib.parse import urlparse
+from urllib.parse import urlparse
from getpass import getuser
diff --git a/tests/features/steps/wrappers.py b/tests/features/steps/wrappers.py
index 61805170..3ebcc92c 100644
--- a/tests/features/steps/wrappers.py
+++ b/tests/features/steps/wrappers.py
@@ -3,10 +3,7 @@ import pexpect
from pgcli.main import COLOR_CODE_REGEX
import textwrap
-try:
- from StringIO import StringIO
-except ImportError:
- from io import StringIO
+from io import StringIO
def expect_exact(context, expected, timeout):