diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-07-15 18:34:08 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-07-15 18:34:08 +0000 |
commit | 93bdc0af136671736a6b68083efed7a0d2879739 (patch) | |
tree | 4f36525033aefee4a76c04ed632b3d42a356ea58 | |
parent | da439471c5adfc402290657ad338f557b8f4a181 (diff) | |
download | portage-93bdc0af136671736a6b68083efed7a0d2879739.tar.gz portage-93bdc0af136671736a6b68083efed7a0d2879739.tar.bz2 portage-93bdc0af136671736a6b68083efed7a0d2879739.zip |
Simplify portage.normalize_path() logic.
svn path=/main/trunk/; revision=3889
-rw-r--r-- | pym/portage.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pym/portage.py b/pym/portage.py index 00f6a427f..a50b573da 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -188,11 +188,11 @@ def prefix_array(array,prefix,doblanks=1): return newarray def normalize_path(mypath): - newpath = os.path.normpath(mypath) - if len(newpath) > 1: - if newpath[:2] == "//": - newpath = newpath[1:] - return newpath + if mypath.startswith(os.path.sep): + # posixpath.normpath collapses 3 or more leading slashes to just 1. + return os.path.normpath(2*os.path.sep + mypath) + else: + return os.path.normpath(mypath) dircache = {} cacheHit=0 |