diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2019-10-27 18:17:30 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-27 18:17:30 -0400 |
| commit | e3068ee28f37064d08c3f55557536454be47b0cd (patch) | |
| tree | a8893ab769146f3c1948dc8517aae9067ffd95f3 /setuptools | |
| parent | 230d1f74eea0dd84a022bc8cfd803256f16f3b97 (diff) | |
| parent | 43add1d3f5138e38adc4940647cc6eae94fb6123 (diff) | |
| download | external_python_setuptools-e3068ee28f37064d08c3f55557536454be47b0cd.tar.gz external_python_setuptools-e3068ee28f37064d08c3f55557536454be47b0cd.tar.bz2 external_python_setuptools-e3068ee28f37064d08c3f55557536454be47b0cd.zip | |
Merge pull request #1824 from asottile/python310
Fixes for python3.10
Diffstat (limited to 'setuptools')
| -rw-r--r-- | setuptools/command/bdist_egg.py | 2 | ||||
| -rw-r--r-- | setuptools/command/easy_install.py | 6 | ||||
| -rw-r--r-- | setuptools/package_index.py | 2 | ||||
| -rw-r--r-- | setuptools/tests/test_bdist_egg.py | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/setuptools/command/bdist_egg.py b/setuptools/command/bdist_egg.py index 9f8df917..98470f17 100644 --- a/setuptools/command/bdist_egg.py +++ b/setuptools/command/bdist_egg.py @@ -284,7 +284,7 @@ class bdist_egg(Command): "or refer to a module" % (ep,) ) - pyver = sys.version[:3] + pyver = '{}.{}'.format(*sys.version_info) pkg = ep.module_name full = '.'.join(ep.attrs) base = ep.attrs[0] diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index d7b7566c..545c3c44 100644 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -241,7 +241,7 @@ class easy_install(Command): """ Render the Setuptools version and installation details, then exit. """ - ver = sys.version[:3] + ver = '{}.{}'.format(*sys.version_info) dist = get_distribution('setuptools') tmpl = 'setuptools {dist.version} from {dist.location} (Python {ver})' print(tmpl.format(**locals())) @@ -1411,7 +1411,7 @@ def get_site_dirs(): os.path.join( prefix, "lib", - "python" + sys.version[:3], + "python{}.{}".format(*sys.version_info), "site-packages", ), os.path.join(prefix, "lib", "site-python"), @@ -1432,7 +1432,7 @@ def get_site_dirs(): home, 'Library', 'Python', - sys.version[:3], + '{}.{}'.format(*sys.version_info), 'site-packages', ) sitedirs.append(home_sp) diff --git a/setuptools/package_index.py b/setuptools/package_index.py index 6b06f2ca..f419d471 100644 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -46,7 +46,7 @@ __all__ = [ _SOCKET_TIMEOUT = 15 _tmpl = "setuptools/{setuptools.__version__} Python-urllib/{py_major}" -user_agent = _tmpl.format(py_major=sys.version[:3], setuptools=setuptools) +user_agent = _tmpl.format(py_major='{}.{}'.format(*sys.version_info), setuptools=setuptools) def parse_requirement_arg(spec): diff --git a/setuptools/tests/test_bdist_egg.py b/setuptools/tests/test_bdist_egg.py index 54742aa6..fb5b90b1 100644 --- a/setuptools/tests/test_bdist_egg.py +++ b/setuptools/tests/test_bdist_egg.py @@ -42,7 +42,7 @@ class Test: # let's see if we got our egg link at the right place [content] = os.listdir('dist') - assert re.match(r'foo-0.0.0-py[23].\d.egg$', content) + assert re.match(r'foo-0.0.0-py[23].\d+.egg$', content) @pytest.mark.xfail( os.environ.get('PYTHONDONTWRITEBYTECODE'), |
