From e59906299a9f3bbbe316af9c288396d8424cd575 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Mon, 2 Sep 2013 12:11:50 +0000 Subject: sysbranchdir: simplify prefix / strip There's a built-in function to do this. --- morphlib/sysbranchdir.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/morphlib/sysbranchdir.py b/morphlib/sysbranchdir.py index 9ad1e2fd..0b3c859a 100644 --- a/morphlib/sysbranchdir.py +++ b/morphlib/sysbranchdir.py @@ -95,8 +95,7 @@ class SystemBranchDirectory(object): # Remove anyleading slashes, or os.path.join below will only # use the relative part (since it's absolute, not relative). - while relative.startswith('/'): - relative = relative[1:] + relative = relative.lstrip('/') return os.path.join(self.root_directory, relative) -- cgit v1.2.1