diff options
| author | Anthony Sottile <asottile@umich.edu> | 2019-08-17 19:14:48 -0700 |
|---|---|---|
| committer | Anthony Sottile <asottile@umich.edu> | 2019-08-17 19:18:07 -0700 |
| commit | 43add1d3f5138e38adc4940647cc6eae94fb6123 (patch) | |
| tree | 5be3b39a6b43a82ddf113b948484d0e1b75458e7 /setuptools | |
| parent | 2cd2fdcb69426de4bb9d63d638244f4ae6a1ca27 (diff) | |
| download | external_python_setuptools-43add1d3f5138e38adc4940647cc6eae94fb6123.tar.gz external_python_setuptools-43add1d3f5138e38adc4940647cc6eae94fb6123.tar.bz2 external_python_setuptools-43add1d3f5138e38adc4940647cc6eae94fb6123.zip | |
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 06c98271..593ed777 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())) @@ -1412,7 +1412,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"), @@ -1433,7 +1433,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'), |
