mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Merged revisions 73930-73932,73937-73939,73945,73951,73954,73962-73963,73970 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r73930 | amaury.forgeotdarc | 2009-07-10 12:47:42 -0400 (Fri, 10 Jul 2009) | 2 lines #6447: typo in subprocess docstring ........ r73931 | ezio.melotti | 2009-07-10 16:25:56 -0400 (Fri, 10 Jul 2009) | 1 line more cleanups and if zlib -> skipUnless(zlib) ........ r73932 | kristjan.jonsson | 2009-07-11 04:44:43 -0400 (Sat, 11 Jul 2009) | 3 lines http://bugs.python.org/issue6460 Need to be careful with thread switching when testing the xmlrpc server. The server thread may not have updated stats when the client thread tests them. ........ r73937 | georg.brandl | 2009-07-11 06:12:36 -0400 (Sat, 11 Jul 2009) | 1 line Fix style. ........ r73938 | georg.brandl | 2009-07-11 06:14:54 -0400 (Sat, 11 Jul 2009) | 1 line #6446: fix import_spam() function to use correct error and reference handling. ........ r73939 | georg.brandl | 2009-07-11 06:18:10 -0400 (Sat, 11 Jul 2009) | 1 line #6448: clarify docs for find_module(). ........ r73945 | georg.brandl | 2009-07-11 06:51:31 -0400 (Sat, 11 Jul 2009) | 1 line #6456: clarify the meaning of constants used as arguments to nl_langinfo(). ........ r73951 | georg.brandl | 2009-07-11 10:23:38 -0400 (Sat, 11 Jul 2009) | 2 lines array.array is actually a class. ........ r73954 | tarek.ziade | 2009-07-11 13:21:00 -0400 (Sat, 11 Jul 2009) | 1 line reverted changes for #6459 (doesn't apply on 2.x) ........ r73962 | benjamin.peterson | 2009-07-11 18:15:13 -0400 (Sat, 11 Jul 2009) | 1 line put downloaded test support files in Lib/test/data instead of the cwd ........ r73963 | benjamin.peterson | 2009-07-11 18:25:24 -0400 (Sat, 11 Jul 2009) | 1 line ignore things in Lib/test/data/ ........ r73970 | hirokazu.yamamoto | 2009-07-11 22:04:47 -0400 (Sat, 11 Jul 2009) | 1 line Fixed distutils test. ........
This commit is contained in:
parent
ea3714e689
commit
711ed4aedf
10 changed files with 148 additions and 192 deletions
|
@ -453,13 +453,12 @@ def open_urlresource(url, *args, **kw):
|
|||
requires('urlfetch')
|
||||
filename = urllib.parse.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, *args, **kw)
|
||||
fn = os.path.join(os.path.dirname(__file__), "data", filename)
|
||||
if os.path.exists(fn):
|
||||
return open(fn)
|
||||
|
||||
print('\tfetching %s ...' % url, file=get_original_stdout())
|
||||
fn, _ = urllib.request.urlretrieve(url, filename)
|
||||
fn, _ = urllib.request.urlretrieve(url, fn)
|
||||
return open(fn, *args, **kw)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue