mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Workaround for Ubuntu/Debian's brilliant decision to partially backport patches from python 2.7.9 to 2.7.8
This commit is contained in:
parent
77c0113031
commit
d102bc256c
@ -19,7 +19,7 @@ py3 = sys.version_info[0] > 2
|
||||
enc = getattr(sys.stdout, 'encoding', 'UTF-8') or 'utf-8'
|
||||
calibre_version = signature = None
|
||||
urllib = __import__('urllib.request' if py3 else 'urllib', fromlist=1)
|
||||
has_ssl_verify = hasattr(ssl, 'PROTOCOL_TLSv1_2')
|
||||
has_ssl_verify = hasattr(ssl, 'PROTOCOL_TLSv1_2') and sys.version_info[:3] > (2, 7, 8)
|
||||
|
||||
if py3:
|
||||
unicode = str
|
||||
|
@ -6,12 +6,12 @@ from __future__ import (unicode_literals, division, absolute_import,
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
|
||||
import ssl, socket, re
|
||||
import ssl, socket, re, sys
|
||||
from contextlib import closing
|
||||
|
||||
from calibre import get_proxies
|
||||
from calibre.constants import ispy3
|
||||
has_ssl_verify = hasattr(ssl, 'PROTOCOL_TLSv1_2')
|
||||
has_ssl_verify = hasattr(ssl, 'PROTOCOL_TLSv1_2') and sys.version_info[:3] > (2, 7, 8)
|
||||
|
||||
class HTTPError(ValueError):
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user