aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-06-02 09:05:53 -0400
committerJason R. Coombs <jaraco@jaraco.com>2016-06-02 09:05:53 -0400
commit3011dc8a2e831c47ef811a396292f854e95665ba (patch)
treec497697200f3800cdbc7e1c5cdcc760bc275c7bc
parent4a40d24d412c5198d6beee2855accd0f720dd2df (diff)
downloadexternal_python_setuptools-3011dc8a2e831c47ef811a396292f854e95665ba.tar.gz
external_python_setuptools-3011dc8a2e831c47ef811a396292f854e95665ba.tar.bz2
external_python_setuptools-3011dc8a2e831c47ef811a396292f854e95665ba.zip
Refactor setuptools filename as a template and use format strings to construct it.
-rw-r--r--ez_setup.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/ez_setup.py b/ez_setup.py
index fc22046b..4ef3ee01 100644
--- a/ez_setup.py
+++ b/ez_setup.py
@@ -120,11 +120,12 @@ def archive_context(filename):
def _do_download(version, download_base, to_dir, download_delay):
"""Download Setuptools."""
- egg = os.path.join(to_dir, 'setuptools-%s-py%d.%d.egg'
- % (version, sys.version_info[0], sys.version_info[1]))
+ py_desig = 'py{sys.version_info[0]}.{sys.version_info[1]}'.format(sys=sys)
+ tp = 'setuptools-{version}-{py_desig}.egg'
+ egg = os.path.join(to_dir, tp.format(**locals()))
if not os.path.exists(egg):
archive = download_setuptools(version, download_base,
- to_dir, download_delay)
+ to_dir, download_delay)
_build_egg(egg, archive, to_dir)
sys.path.insert(0, egg)