diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2001-01-28 12:23:32 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2001-01-28 12:23:32 (GMT) |
commit | b4cd5c1a3aa11a7b7a180fe1d241968392ab8e33 (patch) | |
tree | a04436de412e594839fc509202ae42269cc21808 /Lib/distutils | |
parent | a221b2a7a961e611bd89988693c4372fb522e7bf (diff) | |
download | cpython-b4cd5c1a3aa11a7b7a180fe1d241968392ab8e33.zip cpython-b4cd5c1a3aa11a7b7a180fe1d241968392ab8e33.tar.gz cpython-b4cd5c1a3aa11a7b7a180fe1d241968392ab8e33.tar.bz2 |
Remove single "." components from pathnames, and return os.curdir if
the resulting path is empty.
Diffstat (limited to 'Lib/distutils')
-rw-r--r-- | Lib/distutils/util.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py index 550d94a..d4891b3 100644 --- a/Lib/distutils/util.py +++ b/Lib/distutils/util.py @@ -82,6 +82,10 @@ def convert_path (pathname): raise ValueError, "path '%s' cannot end with '/'" % pathname paths = string.split(pathname, '/') + while '.' in paths: + paths.remove('.') + if not paths: + return os.curdir return apply(os.path.join, paths) # convert_path () |