[downloader:http] try to import SSL exception class from OpenSSL

(#324)
This commit is contained in:
Mike Fährmann
2019-07-01 20:10:26 +02:00
parent bc6b0cfddc
commit 8966930c5c

View File

@@ -12,10 +12,14 @@ import os
import time
import mimetypes
from requests.exceptions import RequestException, ConnectionError, Timeout
from ssl import SSLError
from .common import DownloaderBase
from .. import text
try:
from OpenSSL.SSL import Error as SSLError
except ImportError:
from ssl import SSLError
class HttpDownloader(DownloaderBase):
scheme = "http"