]> granicus.if.org Git - python/commitdiff
A quick hack to make the test pass on the Mac (similar to the quick hack
authorJack Jansen <jack.jansen@cwi.nl>
Mon, 27 Aug 2001 22:31:58 +0000 (22:31 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Mon, 27 Aug 2001 22:31:58 +0000 (22:31 +0000)
to make it pass on Windows:-).

Lib/test/test_urllib2.py

index 80356f84d77389e7601ce9953b20094831faa917..5b4c68c296fdddc4b9aa975c07ffc2e6a83e238b 100644 (file)
@@ -15,6 +15,10 @@ else:
 fname = os.path.abspath(urllib2.__file__).replace('\\', '/')
 if fname[1:2] == ":":
     fname = fname[2:]
+# And more hacking to get it to work on MacOS. This assumes
+# urllib.pathname2url works, unfortunately...
+if os.name == 'mac':
+       fname = '/' + fname.replace(':', '/')
 file_url = "file://%s" % fname
 f = urllib2.urlopen(file_url)