mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
put downloaded test support files in Lib/test/data instead of the cwd
This commit is contained in:
parent
51f32c00e8
commit
9bd39c119e
4 changed files with 5 additions and 39 deletions
|
@ -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)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue