Skip to content

Commit

Permalink
put downloaded test support files in Lib/test/data instead of the cwd
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminp committed Jul 11, 2009
1 parent 51f32c0 commit 9bd39c1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 39 deletions.
17 changes: 0 additions & 17 deletions .bzrignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 0 additions & 17 deletions .hgignore
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -28,7 +12,6 @@ config.log
config.status
config.status.lineno
db_home
gb-18030-2000.xml
platform
pyconfig.h
python
Expand Down
9 changes: 4 additions & 5 deletions Lib/test/test_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
1 change: 1 addition & 0 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 '*~' \
Expand Down

0 comments on commit 9bd39c1

Please sign in to comment.