diff options
author | Daniele Tricoli <eriol@mornie.org> | 2014-11-14 03:52:02 +0000 |
---|---|---|
committer | Daniele Tricoli <eriol@mornie.org> | 2014-11-14 03:52:02 +0000 |
commit | 14dc4eca16b91b7ddb4f56b05e2f8fbc649cded5 (patch) | |
tree | be75e3ac14db9a9263f0b587aae2d8742723b9e2 /debian/patches | |
parent | 9ff5bf44d0521b90d730015577b2051c4cf3645c (diff) | |
download | python-requests-14dc4eca16b91b7ddb4f56b05e2f8fbc649cded5.tar python-requests-14dc4eca16b91b7ddb4f56b05e2f8fbc649cded5.tar.gz |
* debian/patches/04_make-requests.packages.urllib3-same-as-urllib3.patch
- Fix requests.packages.urllib3 sub on Python 3. Thanks to Tianon
Gravi for the report. (Closes: #769496)
Diffstat (limited to 'debian/patches')
-rw-r--r-- | debian/patches/04_make-requests.packages.urllib3-same-as-urllib3.patch | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/debian/patches/04_make-requests.packages.urllib3-same-as-urllib3.patch b/debian/patches/04_make-requests.packages.urllib3-same-as-urllib3.patch index e26d9ae..4e6f053 100644 --- a/debian/patches/04_make-requests.packages.urllib3-same-as-urllib3.patch +++ b/debian/patches/04_make-requests.packages.urllib3-same-as-urllib3.patch @@ -3,11 +3,12 @@ urllib3 are the same thing. Author: Jakub Wilk <jwilk@debian.org> Forwarded: not-needed Bug-Debian: https://bugs.debian.org/769047 -Last-Update: 2014-11-05 +Bug-Debian: https://bugs.debian.org/769496 +Last-Update: 2014-11-14 --- a/requests/__init__.py +++ b/requests/__init__.py -@@ -48,6 +48,24 @@ +@@ -48,6 +48,28 @@ __license__ = 'Apache 2.0' __copyright__ = 'Copyright 2014 Kenneth Reitz' @@ -18,6 +19,8 @@ Last-Update: 2014-11-05 +import urllib3 + +def _attach_namespace(package, where): ++ # Attach package top namespace ++ sys.modules[where + '.' + package.__name__] = package + for loader, name, ispkg in pkgutil.walk_packages(package.__path__, + package.__name__ + '.'): + try: @@ -28,7 +31,16 @@ Last-Update: 2014-11-05 + +_attach_namespace(urllib3, 'requests.packages') +del _attach_namespace ++# Python 3 needs this imported explicitly. ++import requests.packages + # Attempt to enable urllib3's SNI support, if possible try: from urllib3.contrib import pyopenssl +--- a/requests/packages/__init__.py ++++ b/requests/packages/__init__.py +@@ -1,3 +1,3 @@ + from __future__ import absolute_import + +-from . import urllib3 ++import urllib3 |