summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-01-28 12:23:32 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-01-28 12:23:32 (GMT)
commitb4cd5c1a3aa11a7b7a180fe1d241968392ab8e33 (patch)
treea04436de412e594839fc509202ae42269cc21808
parenta221b2a7a961e611bd89988693c4372fb522e7bf (diff)
downloadcpython-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.
-rw-r--r--Lib/distutils/util.py4
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 ()