[oe-commits] Chris Larson : oe.path.join: simplify a bit

git version control git at git.openembedded.org
Fri Apr 23 21:20:46 UTC 2010


Module: openembedded.git
Branch: org.openembedded.dev
Commit: 38cf80fce6aff11422770d84f21113f38c8dc57a
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=38cf80fce6aff11422770d84f21113f38c8dc57a

Author: Chris Larson <chris_larson at mentor.com>
Date:   Wed Apr 14 18:04:55 2010 -0700

oe.path.join: simplify a bit

Signed-off-by: Chris Larson <chris_larson at mentor.com>

---

 lib/oe/path.py |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/lib/oe/path.py b/lib/oe/path.py
index dbaa08d..7dafdb1 100644
--- a/lib/oe/path.py
+++ b/lib/oe/path.py
@@ -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.





More information about the Openembedded-commits mailing list