diff --git a/setup.py b/setup.py index 3f1a9a00..c8d48eb7 100644 --- a/setup.py +++ b/setup.py @@ -137,9 +137,12 @@ class CustomInstall(install): 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