summaryrefslogtreecommitdiff
path: root/pkg_resources
diff options
context:
space:
mode:
authorAnthony Sottile <asottile@umich.edu>2019-08-17 19:14:48 -0700
committerAnthony Sottile <asottile@umich.edu>2019-08-17 19:18:07 -0700
commit43add1d3f5138e38adc4940647cc6eae94fb6123 (patch)
tree5be3b39a6b43a82ddf113b948484d0e1b75458e7 /pkg_resources
parent2cd2fdcb69426de4bb9d63d638244f4ae6a1ca27 (diff)
downloadpython-setuptools-git-43add1d3f5138e38adc4940647cc6eae94fb6123.tar.gz
Fixes for python3.10
Diffstat (limited to 'pkg_resources')
-rw-r--r--pkg_resources/__init__.py2
-rw-r--r--pkg_resources/api_tests.txt2
-rw-r--r--pkg_resources/tests/test_resources.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py
index 1f170cfd..fb68813e 100644
--- a/pkg_resources/__init__.py
+++ b/pkg_resources/__init__.py
@@ -333,7 +333,7 @@ class UnknownExtra(ResolutionError):
_provider_factories = {}
-PY_MAJOR = sys.version[:3]
+PY_MAJOR = '{}.{}'.format(*sys.version_info)
EGG_DIST = 3
BINARY_DIST = 2
SOURCE_DIST = 1
diff --git a/pkg_resources/api_tests.txt b/pkg_resources/api_tests.txt
index 0a75170e..7ae5a038 100644
--- a/pkg_resources/api_tests.txt
+++ b/pkg_resources/api_tests.txt
@@ -36,7 +36,7 @@ Distributions have various introspectable attributes::
>>> dist.version
'0.9'
- >>> dist.py_version == sys.version[:3]
+ >>> dist.py_version == '{}.{}'.format(*sys.version_info)
True
>>> print(dist.platform)
diff --git a/pkg_resources/tests/test_resources.py b/pkg_resources/tests/test_resources.py
index 86afcf74..7063ed3d 100644
--- a/pkg_resources/tests/test_resources.py
+++ b/pkg_resources/tests/test_resources.py
@@ -116,7 +116,7 @@ class TestDistro:
self.checkFooPkg(d)
d = Distribution("/some/path")
- assert d.py_version == sys.version[:3]
+ assert d.py_version == '{}.{}'.format(*sys.version_info)
assert d.platform is None
def testDistroParse(self):