diff options
| author | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2023-04-19 17:18:27 +0100 |
|---|---|---|
| committer | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2023-04-19 17:18:27 +0100 |
| commit | ac07f21af8ee73e32448bb0429469b56f412a597 (patch) | |
| tree | c45e8284ca8668b8aa594deed813145adc1264b8 /pkg_resources | |
| parent | 245d72a8aa4d47e1811425213aba2a06a0bb64fa (diff) | |
| download | python-setuptools-git-ac07f21af8ee73e32448bb0429469b56f412a597.tar.gz | |
Handle Python3.12a7 compatibility problems
Diffstat (limited to 'pkg_resources')
| -rw-r--r-- | pkg_resources/__init__.py | 3 | ||||
| -rw-r--r-- | pkg_resources/tests/test_pkg_resources.py | 8 | ||||
| -rw-r--r-- | pkg_resources/tests/test_resources.py | 4 |
3 files changed, 15 insertions, 0 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py index a73a1df3..8159afd2 100644 --- a/pkg_resources/__init__.py +++ b/pkg_resources/__init__.py @@ -3046,6 +3046,9 @@ class Distribution: except ValueError: issue_warning("Unbuilt egg for " + repr(self)) return False + except SystemError: + # TODO: remove this except clause when python/cpython#103632 is fixed. + return False return True def clone(self, **kw): diff --git a/pkg_resources/tests/test_pkg_resources.py b/pkg_resources/tests/test_pkg_resources.py index 684c9777..fd5cc8ce 100644 --- a/pkg_resources/tests/test_pkg_resources.py +++ b/pkg_resources/tests/test_pkg_resources.py @@ -256,6 +256,10 @@ def make_distribution_no_version(tmpdir, basename): ('dist-info', 'METADATA', DistInfoDistribution), ], ) +@pytest.mark.xfail( + sys.version_info[:2] == (3, 12) and sys.version_info.releaselevel != 'final', + reason="https://github.com/python/cpython/issues/103632", +) def test_distribution_version_missing( tmpdir, suffix, expected_filename, expected_dist_type): """ @@ -286,6 +290,10 @@ def test_distribution_version_missing( assert type(dist) == expected_dist_type +@pytest.mark.xfail( + sys.version_info[:2] == (3, 12) and sys.version_info.releaselevel != 'final', + reason="https://github.com/python/cpython/issues/103632", +) def test_distribution_version_missing_undetected_path(): """ Test Distribution.version when the "Version" header is missing and diff --git a/pkg_resources/tests/test_resources.py b/pkg_resources/tests/test_resources.py index 2138f95e..baf477db 100644 --- a/pkg_resources/tests/test_resources.py +++ b/pkg_resources/tests/test_resources.py @@ -319,6 +319,10 @@ class TestDistro: res = list(ws.resolve(parse_requirements("a"), ad)) assert res == [a, c, b, foo] + @pytest.mark.xfail( + sys.version_info[:2] == (3, 12) and sys.version_info.releaselevel != 'final', + reason="https://github.com/python/cpython/issues/103632", + ) def testDistroDependsOptions(self): d = self.distRequires(""" Twisted>=1.5 |
