diff options
author | Greg Ward <gward@python.net> | 2000-05-31 02:32:10 (GMT) |
---|---|---|
committer | Greg Ward <gward@python.net> | 2000-05-31 02:32:10 (GMT) |
commit | d8dfb4c4b8d661acee263e3feb77974ced69e97d (patch) | |
tree | 19fd4f8d8b032f885118e9e181d67b87820e8762 /Lib/distutils/util.py | |
parent | 65bc20c23e22543e13ff6d1fbdf51705a0b5aa1a (diff) | |
download | cpython-d8dfb4c4b8d661acee263e3feb77974ced69e97d.zip cpython-d8dfb4c4b8d661acee263e3feb77974ced69e97d.tar.gz cpython-d8dfb4c4b8d661acee263e3feb77974ced69e97d.tar.bz2 |
Renamed 'native_path()' to 'convert_path()'.
Also changed it so it doesn't barf if the path is already in native format
(ie. contains os.sep).
Diffstat (limited to 'Lib/distutils/util.py')
-rw-r--r-- | Lib/distutils/util.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py index 6063aa6..5754638 100644 --- a/Lib/distutils/util.py +++ b/Lib/distutils/util.py @@ -58,7 +58,7 @@ def get_platform (): # get_platform() -def native_path (pathname): +def convert_path (pathname): """Return 'pathname' as a name that will work on the native filesystem, i.e. split it on '/' and put it back together again using the current directory separator. Needed because filenames in @@ -73,16 +73,12 @@ def native_path (pathname): if pathname[-1] == '/': raise ValueError, "path '%s' cannot end with '/'" % pathname if os.sep != '/': - if os.sep in pathname: - raise ValueError, \ - "path '%s' cannot contain '%c' character" % (pathname, os.sep) - else: - paths = string.split (pathname, '/') - return apply (os.path.join, paths) + paths = string.split (pathname, '/') + return apply (os.path.join, paths) else: return pathname -# native_path () +# convert_path () def change_root (new_root, pathname): |