mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Merged revisions 78838-78839,78917,78919,78934,78937 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r78838 | florent.xicluna | 2010-03-11 15:36:19 +0100 (jeu, 11 mar 2010) | 2 lines Issue #6472: The xml.etree package is updated to ElementTree 1.3. The cElementTree module is updated too. ........ r78839 | florent.xicluna | 2010-03-11 16:55:11 +0100 (jeu, 11 mar 2010) | 2 lines Fix repr of tree Element on windows. ........ r78917 | florent.xicluna | 2010-03-13 12:18:49 +0100 (sam, 13 mar 2010) | 2 lines Move the xml test data to their own directory. ........ r78919 | florent.xicluna | 2010-03-13 13:41:48 +0100 (sam, 13 mar 2010) | 2 lines Do not chdir when running test_xml_etree, and enhance the findfile helper. ........ r78934 | florent.xicluna | 2010-03-13 18:56:19 +0100 (sam, 13 mar 2010) | 2 lines Update some parts of the xml.etree documentation. ........ r78937 | florent.xicluna | 2010-03-13 21:30:15 +0100 (sam, 13 mar 2010) | 3 lines Add the keyword argument "method=None" to the .write() method and the tostring/tostringlist functions. Update the function, class and method signatures, according to the new convention. ........
This commit is contained in:
parent
9451a1c6ae
commit
f15351d938
19 changed files with 3534 additions and 1327 deletions
|
@ -402,12 +402,14 @@ def temp_cwd(name='tempcwd', quiet=False):
|
|||
rmtree(name)
|
||||
|
||||
|
||||
def findfile(file, here=__file__):
|
||||
def findfile(file, here=__file__, subdir=None):
|
||||
"""Try to find a file on sys.path and the working directory. If it is not
|
||||
found the argument passed to the function is returned (this does not
|
||||
necessarily signal failure; could still be the legitimate path)."""
|
||||
if os.path.isabs(file):
|
||||
return file
|
||||
if subdir is not None:
|
||||
file = os.path.join(subdir, file)
|
||||
path = sys.path
|
||||
path = [os.path.dirname(here)] + path
|
||||
for dn in path:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue