summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2010-06-27 14:00:56 (GMT)
committerRonald Oussoren <ronaldoussoren@mac.com>2010-06-27 14:00:56 (GMT)
commit68f74ba556e348cd3f2b7ca4638e363d6a8625f1 (patch)
tree67b0c2d15271ab8466da8fc1b7027c25989d74b0
parent3d3ffd8c44a50645d04aa5b8ca503df0b5089c1f (diff)
downloadcpython-68f74ba556e348cd3f2b7ca4638e363d6a8625f1.zip
cpython-68f74ba556e348cd3f2b7ca4638e363d6a8625f1.tar.gz
cpython-68f74ba556e348cd3f2b7ca4638e363d6a8625f1.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. ........
-rw-r--r--Lib/urllib.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py
index 70900cd..da4f56e 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -1375,8 +1375,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