# HG changeset patch # User souliane # Date 1407947986 -7200 # Node ID 8e15eeb3cfc33cc96693174515c66c862288adde # Parent e2e1e27a3680d2398c574877d8051c0a7989875e setup: cleaning also handles egg filenames not containing the python version diff -r e2e1e27a3680 -r 8e15eeb3cfc3 setup.py --- a/setup.py Wed Aug 13 14:48:49 2014 +0200 +++ b/setup.py Wed Aug 13 18:39:46 2014 +0200 @@ -128,10 +128,13 @@ message = "Cleaning previous installation directories" if to_remove is None: to_remove = [] - to_remove.extend([os.path.join(self.install_lib, NAME), - os.path.join(self.install_data, 'share', 'doc', NAME), - os.path.join(self.install_lib, "%s-py%s.egg-info" % (self.config_vars['dist_fullname'], self.config_vars['py_version_short'])), - ]) + for path in [os.path.join(self.install_lib, NAME), + os.path.join(self.install_data, 'share', 'doc', NAME), + os.path.join(self.install_lib, "%s.egg-info" % self.config_vars['dist_fullname']), + os.path.join(self.install_lib, "%s-py%s.egg-info" % (self.config_vars['dist_fullname'], self.config_vars['py_version_short'])), + ]: + if os.path.isdir(path): + to_remove.append(path) for source, dest in self.sh_script_links: if os.path.islink(dest): to_remove.append(dest)