summaryrefslogtreecommitdiffstats
path: root/Lib/urllib
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2010-06-27 14:26:30 (GMT)
committerRonald Oussoren <ronaldoussoren@mac.com>2010-06-27 14:26:30 (GMT)
commitab90f8e6a1a2f3f13b4775f431c75ec995a048d1 (patch)
tree2144525e2e90baa1915d2d9742a9a649fc8044f4 /Lib/urllib
parentc943de2b5a6dca4922f9f7f6c4f34d8c93684bbc (diff)
downloadcpython-ab90f8e6a1a2f3f13b4775f431c75ec995a048d1.zip
cpython-ab90f8e6a1a2f3f13b4775f431c75ec995a048d1.tar.gz
cpython-ab90f8e6a1a2f3f13b4775f431c75ec995a048d1.tar.bz2
Merged revisions 82284 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r82284 | ronald.oussoren | 2010-06-27 15:59:39 +0200 (Sun, 27 Jun 2010) | 4 lines Fix for Issue8883: without this patch test_urllib will fail when there is a bare IP address in the "Bypass proxy settings for these Hosts & Domains" list on MacOSX. ........
Diffstat (limited to 'Lib/urllib')
-rw-r--r--Lib/urllib/request.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index 15e2dde..f7c7416 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -2204,8 +2204,13 @@ if sys.platform == 'darwin':
continue
base = ip2num(m.group(1))
- mask = int(m.group(2)[1:])
- mask = 32 - mask
+ mask = m.group(2)
+ if mask is None:
+ mask = 8 * (m.group(1).count('.') + 1)
+
+ else:
+ mask = int(mask[1:])
+ mask = 32 - mask
if (hostIP >> mask) == (base >> mask):
return True