diff setup.py @ 1156:cc022c1cc09f

misc (install): fixed self.root access when it's not used
author Goffi <goffi@goffi.org>
date Wed, 03 Sep 2014 17:55:05 +0200
parents a1d47760df3f
children ca15fb1abbc4
line wrap: on
line diff
--- a/setup.py	Wed Sep 03 17:44:19 2014 +0200
+++ b/setup.py	Wed Sep 03 17:55:05 2014 +0200
@@ -137,9 +137,12 @@
                 os.symlink(source, dest)
 
     def run(self):
-        ignore_idx = 0 if self.root is None else len(self.root)
-        if self.root[-1] == '/':
-            ignore_idx-=1 # we dont want to remove the first '/' in _final paths
+        if not self.root:
+            ignore_idx = 0
+        else:
+            ignore_idx = len(self.root)
+            if self.root[-1] == '/':
+                ignore_idx-=1 # we dont want to remove the first '/' in _final paths
         # _final suffixed attributes are the ones without the self.root prefix path
         # it's used at least on Arch linux installation as install is made on a local $pkgdir
         # which is later moved to user's FS root