From: Benjamin Peterson Date: Sat, 11 Jul 2009 22:15:13 +0000 (+0000) Subject: put downloaded test support files in Lib/test/data instead of the cwd X-Git-Tag: v2.7a1~790 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9bd39c119e9b858c18191e0c1a7ffe5c3bcd1fe2;p=python put downloaded test support files in Lib/test/data instead of the cwd --- diff --git a/.bzrignore b/.bzrignore index 52143a9adf..7505ac499a 100644 --- a/.bzrignore +++ b/.bzrignore @@ -14,24 +14,7 @@ platform pyconfig.h libpython*.a python.exe -CP936.TXT -SHIFT_JISX0213.TXT -JOHAB.TXT -EUC-JP.TXT -NormalizationTest-3.2.0.txt -NormalizationTest.txt -BIG5.TXT -BIG5HKSCS-2004.TXT -CP949.TXT -EUC-CN.TXT -BIG5HKSCS.TXT -SHIFTJIS.TXT -EUC-KR.TXT -EUC-JISX0213.TXT -CP932.TXT -CP950.TXT reflog.txt -gb-18030-2000.xml tags TAGS .gdb_history diff --git a/.hgignore b/.hgignore index 77def91145..ee1bd43cc5 100644 --- a/.hgignore +++ b/.hgignore @@ -1,24 +1,8 @@ .gdb_history .purify .svn -BIG5.TXT -BIG5HKSCS-2004.TXT -BIG5HKSCS.TXT -CP932.TXT -CP936.TXT -CP949.TXT -CP950.TXT -EUC-CN.TXT -EUC-JISX0213.TXT -EUC-JP.TXT -EUC-KR.TXT -JOHAB.TXT Makefile Makefile.pre -NormalizationTest-3.2.0.txt -NormalizationTest.txt -SHIFTJIS.TXT -SHIFT_JISX0213.TXT TAGS autom4te.cache build @@ -28,7 +12,6 @@ config.log config.status config.status.lineno db_home -gb-18030-2000.xml platform pyconfig.h python diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index 4b14c3be27..432fa52934 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) diff --git a/Makefile.pre.in b/Makefile.pre.in index 71ded8e3d7..42837f6f47 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1173,6 +1173,7 @@ clobber: clean profile-removal # remove all generated files, even Makefile[.pre] # Keep configure and Python-ast.[ch], it's possible they can't be generated distclean: clobber + -rm -f Lib/test/data/* -rm -f core Makefile Makefile.pre config.status \ Modules/Setup Modules/Setup.local Modules/Setup.config find $(srcdir) '(' -name '*.fdc' -o -name '*~' \