Skip to content

Commit 989d33b

Browse files
committed
Update Python version support.
1 parent e764373 commit 989d33b

File tree

5 files changed

+5
-13
lines changed

5 files changed

+5
-13
lines changed

src/ComputedAttribute/tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ def test_compilation(self):
9797
from ExtensionClass import _IS_PYPY
9898
try:
9999
from ComputedAttribute import _ComputedAttribute
100+
# ModuleNotFoundError is not possible here:
100101
except ImportError: # pragma: no cover
101102
self.assertTrue(_IS_PYPY)
102103
else:

src/ExtensionClass/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,5 +355,5 @@ class NoInstanceDictionaryBase(Base):
355355
# macro from ExtensionClass.h doesn't break with an AttributeError
356356
try:
357357
from ._ExtensionClass import CAPI2 # noqa: F401 import unused
358-
except ImportError: # pragma: no cover
358+
except ModuleNotFoundError: # pragma: no cover
359359
pass

src/ExtensionClass/_compat.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,6 @@
4747
# define _PyObject_CAST(op) ((PyObject*)(op))
4848
#endif
4949

50-
#if PY_VERSION_HEX < 0x030900A4 && !defined(Py_SET_TYPE)
51-
static inline void
52-
_Py_SET_TYPE(PyObject *ob, PyTypeObject *type)
53-
{
54-
ob->ob_type = type;
55-
}
56-
#define Py_SET_TYPE(ob, type) _Py_SET_TYPE(_PyObject_CAST(ob), type)
57-
#endif
58-
5950
#ifdef PYTHONCAPI_COMPAT_MSC_INLINE
6051
# undef inline
6152
# undef PYTHONCAPI_COMPAT_MSC_INLINE

src/ExtensionClass/tests.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
##############################################################################
1414

1515

16-
import sys
1716
import unittest
1817
from doctest import DocTestSuite
1918

@@ -999,8 +998,7 @@ class _Derived(_Base):
999998
already = object()
1000999
mro = [already]
10011000
self._callFUT(mro, _Derived)
1002-
self.assertEqual(mro, [already, _Derived, _Base] +
1003-
([object] if sys.version_info[0] > 2 else []))
1001+
self.assertEqual(mro, [already, _Derived, _Base, object])
10041002

10051003

10061004
class TestExtensionClass(unittest.TestCase):
@@ -1012,6 +1010,7 @@ def test_compilation(self):
10121010
from ExtensionClass import _IS_PYPY
10131011
try:
10141012
from ExtensionClass import _ExtensionClass
1013+
# ModuleNotFoundError is not possible here:
10151014
except ImportError: # pragma: no cover
10161015
self.assertTrue(_IS_PYPY)
10171016
else:

src/MethodObject/tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def test_compilation(self):
2121
from ExtensionClass import _IS_PYPY
2222
try:
2323
from MethodObject import _MethodObject
24+
# ModuleNotFoundError is not possible here:
2425
except ImportError: # pragma: no cover
2526
self.assertTrue(_IS_PYPY)
2627
else:

0 commit comments

Comments
 (0)