Fix 'convert_path()' so it returns immediately under Unix -- prevents blowing
authorGreg Ward <gward@python.net>
Fri, 22 Sep 2000 01:05:43 +0000 (01:05 +0000)
committerGreg Ward <gward@python.net>
Fri, 22 Sep 2000 01:05:43 +0000 (01:05 +0000)
up when the pathname starts with '/', which is needed when converting
installation directories in the "install" command.

Lib/distutils/util.py

index b60e39c709353ccca26b49823c9c225eda1b2031..3f068078548bea54038b8944fd67de5cdc4a15b6 100644 (file)
@@ -68,15 +68,15 @@ def convert_path (pathname):
        absolute (starts with '/') or contains local directory separators
        (unless the local separator is '/', of course)."""
 
+    if os.sep == '/':
+        return pathname
     if pathname[0] == '/':
         raise ValueError, "path '%s' cannot be absolute" % pathname
     if pathname[-1] == '/':
         raise ValueError, "path '%s' cannot end with '/'" % pathname
-    if os.sep != '/':
-        paths = string.split (pathname, '/')
-        return apply (os.path.join, paths)
-    else:
-        return pathname
+
+    paths = string.split(pathname, '/')
+    return apply(os.path.join, paths)
 
 # convert_path ()