oe.path.join: simplify a bit
authorChris Larson <chris_larson@mentor.com>
Thu, 15 Apr 2010 01:04:55 +0000 (18:04 -0700)
committerChris Larson <chris_larson@mentor.com>
Fri, 23 Apr 2010 21:20:42 +0000 (14:20 -0700)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
lib/oe/path.py

index dbaa08d..7dafdb1 100644 (file)
@@ -1,12 +1,7 @@
-def join(a, *p):
+def join(*paths):
     """Like os.path.join but doesn't treat absolute RHS specially"""
-    path = a
-    for b in p:
-        if path == '' or path.endswith('/'):
-            path +=  b
-        else:
-            path += '/' + b
-    return path
+    import os.path
+    return os.path.normpath("/".join(paths))
 
 def relative(src, dest):
     """ Return a relative path from src to dest.