diff --git a/src/calibre/srv/tests/auth.py b/src/calibre/srv/tests/auth.py index c837a0eddd..587fbd6d6b 100644 --- a/src/calibre/srv/tests/auth.py +++ b/src/calibre/srv/tests/auth.py @@ -11,6 +11,7 @@ import subprocess import time from collections import namedtuple from http.cookiejar import CookieJar +from urllib.error import HTTPError from calibre.constants import ismacos from calibre.ptempfile import TemporaryDirectory @@ -19,7 +20,7 @@ from calibre.srv.routes import Router, endpoint from calibre.srv.tests.base import BaseTest, TestServer from polyglot.binary import as_base64_bytes from polyglot.builtins import itervalues -from polyglot.urllib import HTTPBasicAuthHandler, HTTPCookieProcessor, HTTPDigestAuthHandler, HTTPError, build_opener +from polyglot.urllib import HTTPBasicAuthHandler, HTTPCookieProcessor, HTTPDigestAuthHandler, build_opener REALM = 'calibre-test' is_ci = os.environ.get('CI', '').lower() == 'true' diff --git a/src/calibre/web/fetch/simple.py b/src/calibre/web/fetch/simple.py index 914d7502d8..389c20066b 100644 --- a/src/calibre/web/fetch/simple.py +++ b/src/calibre/web/fetch/simple.py @@ -19,6 +19,7 @@ import time import traceback from base64 import standard_b64decode from http.client import responses +from urllib.error import URLError from urllib.request import urlopen from calibre import browser, relpath, unicode_path @@ -31,7 +32,7 @@ from calibre.utils.imghdr import what from calibre.utils.localization import _ from calibre.utils.logging import Log from calibre.web.fetch.utils import rescale_image -from polyglot.urllib import URLError, quote, url2pathname, urljoin, urlparse, urlsplit, urlunparse, urlunsplit +from polyglot.urllib import quote, url2pathname, urljoin, urlparse, urlsplit, urlunparse, urlunsplit class AbortArticle(Exception):