From 7b8299677ffa5a97de4523e300b754e50824387f Mon Sep 17 00:00:00 2001 From: Daniele Tricoli Date: Sun, 23 Aug 2015 19:23:30 +0000 Subject: Add debian/patches/06_rely-on-six-to-import-httplib-or-http.client.patch Rely on six to import httplib or http.client. Thanks to Edward Betts for the report. (Closes: #796356) --- debian/changelog | 8 ++++++ ...y-on-six-to-import-httplib-or-http.client.patch | 32 ++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 41 insertions(+) create mode 100644 debian/patches/06_rely-on-six-to-import-httplib-or-http.client.patch diff --git a/debian/changelog b/debian/changelog index 3fdef6e..f4195d1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +python-urllib3 (1.11-2) UNRELEASED; urgency=medium + + * debian/patches/06_rely-on-six-to-import-httplib-or-http.client.patch + - Rely on six to import httplib or http.client. Thanks to Edward Betts + for the report. (Closes: #796356) + + -- Daniele Tricoli Sun, 23 Aug 2015 21:19:59 +0200 + python-urllib3 (1.11-1) unstable; urgency=medium * New upstream release. diff --git a/debian/patches/06_rely-on-six-to-import-httplib-or-http.client.patch b/debian/patches/06_rely-on-six-to-import-httplib-or-http.client.patch new file mode 100644 index 0000000..a6e4282 --- /dev/null +++ b/debian/patches/06_rely-on-six-to-import-httplib-or-http.client.patch @@ -0,0 +1,32 @@ +Description: Rely on six to import httplib or http.client. +Origin: https://github.com/shazow/urllib3/commit/f4eb94bc36277d5d584683a03fc9eb3950429a15 + +--- a/urllib3/response.py ++++ b/urllib3/response.py +@@ -1,7 +1,3 @@ +-try: +- import http.client as httplib +-except ImportError: +- import httplib + from contextlib import contextmanager + import zlib + import io +@@ -12,6 +8,7 @@ + ProtocolError, DecodeError, ReadTimeoutError, ResponseNotChunked + ) + from six import string_types as basestring, binary_type, PY3 ++from six.moves import http_client as httplib + from .connection import HTTPException, BaseSSLError + from .util.response import is_fp_closed, is_response_to_head + +--- a/urllib3/util/response.py ++++ b/urllib3/util/response.py +@@ -1,7 +1,4 @@ +-try: +- import http.client as httplib +-except ImportError: +- import httplib ++from six.moves import http_client as httplib + + from ..exceptions import HeaderParsingError + diff --git a/debian/patches/series b/debian/patches/series index b77d657..b91b93d 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -3,3 +3,4 @@ 03_force_setuptools.patch 04_relax_nosetests_options.patch 05_avoid-embedded-ssl-match-hostname.patch +06_rely-on-six-to-import-httplib-or-http.client.patch -- cgit v1.2.3