From b4cd5c1a3aa11a7b7a180fe1d241968392ab8e33 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Sun, 28 Jan 2001 12:23:32 +0000 Subject: Remove single "." components from pathnames, and return os.curdir if the resulting path is empty. --- Lib/distutils/util.py | 4 ++++ 1 file changed, 4 insertions(+) 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 () -- cgit v0.12