From: Jack Jansen Date: Sun, 28 Jan 2001 12:23:32 +0000 (+0000) Subject: Remove single "." components from pathnames, and return os.curdir if X-Git-Tag: v2.1a2~115 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b4cd5c1a3aa11a7b7a180fe1d241968392ab8e33;p=thirdparty%2FPython%2Fcpython.git Remove single "." components from pathnames, and return os.curdir if the resulting path is empty. --- diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py index 550d94abb6a7..d4891b3c2add 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 ()