diff options
Diffstat (limited to 'app-misc/anki/files/anki-2.0.3-httplib2-0.7.7.patch')
-rw-r--r-- | app-misc/anki/files/anki-2.0.3-httplib2-0.7.7.patch | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/app-misc/anki/files/anki-2.0.3-httplib2-0.7.7.patch b/app-misc/anki/files/anki-2.0.3-httplib2-0.7.7.patch new file mode 100644 index 000000000000..8a77f250fb6f --- /dev/null +++ b/app-misc/anki/files/anki-2.0.3-httplib2-0.7.7.patch @@ -0,0 +1,38 @@ +https://github.com/dae/anki/issues/1 + +--- libanki/anki/sync.py ++++ libanki/anki/sync.py +@@ -16,6 +16,15 @@ + HTTP_TIMEOUT = 30 + HTTP_PROXY = None + ++try: ++ # httplib2 >=0.7.7 ++ _proxy_info_from_environment = httplib2.proxy_info_from_environment ++ _proxy_info_from_url = httplib2.proxy_info_from_url ++except AttributeError: ++ # httplib2 <0.7.7 ++ _proxy_info_from_environment = httplib2.ProxyInfo.from_environment ++ _proxy_info_from_url = httplib2.ProxyInfo.from_url ++ + # Httplib2 connection object + ###################################################################### + +@@ -42,7 +51,7 @@ + def _setupProxy(): + global HTTP_PROXY + # set in env? +- p = httplib2.ProxyInfo.from_environment() ++ p = _proxy_info_from_environment() + if not p: + # platform-specific fetch + url = None +@@ -59,7 +68,7 @@ + elif 'http' in r: + url = r['http'] + if url: +- p = httplib2.ProxyInfo.from_url(url, _proxyMethod(url)) ++ p = _proxy_info_from_url(url, _proxyMethod(url)) + HTTP_PROXY = p + + def _proxyMethod(url): |