From 93bdc0af136671736a6b68083efed7a0d2879739 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 15 Jul 2006 18:34:08 +0000 Subject: Simplify portage.normalize_path() logic. svn path=/main/trunk/; revision=3889 --- pym/portage.py | 10 +++++----- 1 file 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 -- cgit v1.2.3-1-g7c22