Skip to content

Commit cc3bb8b

Browse files
committed
refactor(searcher): remove Python 2 compatibility code (#170)
Remove try/except fallback for importing quote from urllib that is no longer necessary for Python 3.8+ project.
1 parent b03de4f commit cc3bb8b

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

cernopendata_client/searcher.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,11 @@
1313
import sys
1414
import requests
1515

16+
from urllib.parse import quote
17+
1618
from .config import SERVER_HTTP_URI, SERVER_ROOT_URI, SERVER_HTTPS_URI
1719
from .printer import display_message
1820

19-
try:
20-
from urllib.parse import quote
21-
except ImportError:
22-
# fallback for Python 2
23-
from urllib import quote
24-
2521

2622
def verify_recid(server=None, recid=None):
2723
"""Verify that recid corresponds to a valid Open Data record webpage.

0 commit comments

Comments
 (0)