summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_support.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_support.py')
-rw-r--r--Lib/test/test_support.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
index 4b14c3b..432fa52 100644
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -468,13 +468,12 @@ def open_urlresource(url):
requires('urlfetch')
filename = urlparse.urlparse(url)[2].split('/')[-1] # '/': it's URL!
- for path in [os.path.curdir, os.path.pardir]:
- fn = os.path.join(path, filename)
- if os.path.exists(fn):
- return open(fn)
+ fn = os.path.join(os.path.dirname(__file__), "data", filename)
+ if os.path.exists(fn):
+ return open(fn)
print >> get_original_stdout(), '\tfetching %s ...' % url
- fn, _ = urllib.urlretrieve(url, filename)
+ fn, _ = urllib.urlretrieve(url, fn)
return open(fn)