# HG changeset patch # User Goffi # Date 1409759705 -7200 # Node ID cc022c1cc09f6239aeeeca9e403d9722658bcdb3 # Parent a1d47760df3f4809a7b1ed04264a927848c25d64 misc (install): fixed self.root access when it's not used diff -r a1d47760df3f -r cc022c1cc09f setup.py --- 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