diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2017-11-09 19:36:07 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2017-11-09 19:36:07 -0500 |
commit | 7874d4e0980265937b6957ba05805e00bacc0ed8 (patch) | |
tree | b644e524935f8c3ecf04a27551ea90b2c03ae7d2 | |
parent | 2676c5a277c5e571cdaeed64e5494315d5ec4c1f (diff) | |
download | external_python_setuptools-7874d4e0980265937b6957ba05805e00bacc0ed8.tar.gz external_python_setuptools-7874d4e0980265937b6957ba05805e00bacc0ed8.tar.bz2 external_python_setuptools-7874d4e0980265937b6957ba05805e00bacc0ed8.zip |
Re-use path
-rw-r--r-- | setuptools/command/bdist_egg.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/setuptools/command/bdist_egg.py b/setuptools/command/bdist_egg.py index 4e36c635..5fdb62d9 100644 --- a/setuptools/command/bdist_egg.py +++ b/setuptools/command/bdist_egg.py @@ -241,13 +241,14 @@ class bdist_egg(Command): log.info("Removing .py files from temporary directory") for base, dirs, files in walk_egg(self.bdist_dir): for name in files: + path = os.path.join(base, name) + if name.endswith('.py'): - path = os.path.join(base, name) log.debug("Deleting %s", path) os.unlink(path) if base.endswith('__pycache__'): - path_old = os.path.join(base, name) + path_old = path pattern = r'(?P<name>.+)\.(?P<magic>[^.]+)\.pyc' m = re.match(pattern, name) |