diff options
author | Damien Baty <damien@damienbaty.com> | 2023-03-18 10:22:12 +0100 |
---|---|---|
committer | Damien Baty <damien@damienbaty.com> | 2023-03-18 10:22:12 +0100 |
commit | 1c071770bb037196bd3830258c33c6ad9031c0b3 (patch) | |
tree | ac28b289ef317d241b057d6ca589fd69e0a5ea08 | |
parent | 5e34e0b55766099a2965eaa61e77795fa577f9f4 (diff) |
Remove leftovers of Python 2 support
-rw-r--r-- | pgcli/auth.py | 2 | ||||
-rw-r--r-- | pgcli/main.py | 5 | ||||
-rw-r--r-- | tests/features/steps/wrappers.py | 5 |
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): |