]> granicus.if.org Git - python/commitdiff
Lyle Johnson: fixed broken logic in 'native_path()'.
authorGreg Ward <gward@python.net>
Tue, 25 Apr 2000 01:33:11 +0000 (01:33 +0000)
committerGreg Ward <gward@python.net>
Tue, 25 Apr 2000 01:33:11 +0000 (01:33 +0000)
Lib/distutils/util.py

index 9c436b94749b43d7367c43b6a09dc0f771c2b049..ca20ae047a625976c961d42399079efb287022e0 100644 (file)
@@ -72,13 +72,13 @@ def native_path (pathname):
         raise ValueError, "path '%s' cannot be absolute" % pathname
     if pathname[-1] == '/':
         raise ValueError, "path '%s' cannot end with '/'" % pathname
-    if os.sep != '/' and os.sep in pathname:
-        raise ValueError, \
-              "path '%s' cannot contain '%c' character" % \
-              (pathname, os.sep)
-
-        paths = string.split (pathname, '/')
-        return apply (os.path.join, paths)
+    if os.sep != '/':
+       if os.sep in pathname:
+            raise ValueError, \
+              "path '%s' cannot contain '%c' character" % (pathname, os.sep)
+       else:
+            paths = string.split (pathname, '/')
+            return apply (os.path.join, paths)
     else:
         return pathname