Skip to content

Commit 2ca4a9f

Browse files
committed
Rely on re.sub to perform the decision in one expression.
1 parent e409e80 commit 2ca4a9f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

setuptools/package_index.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -854,8 +854,8 @@ def _resolve_download_filename(cls, url, tmpdir):
854854
'__downloaded__'
855855
)
856856

857-
if name.endswith('.egg.zip'):
858-
name = name[:-4] # strip the extra .zip before download
857+
# strip any extra .zip before download
858+
name = re.sub(r'\.egg\.zip$', '.egg', name)
859859

860860
return os.path.join(tmpdir, name)
861861

0 commit comments

Comments
 (0)