Restored ability to build on Python 2

This commit is contained in:
Matthias Koefferlein 2022-12-28 23:50:38 +01:00
parent 16cd4276b7
commit ca32b34dff
2 changed files with 10 additions and 0 deletions

View File

@ -663,7 +663,12 @@ method_adaptor (int mid, PyObject *self, PyObject *args)
// method is not implemented
if (! meth) {
#if PY_MAJOR_VERSION < 3
PyErr_SetNone(PyExc_NotImplementedError);
return NULL;
#else
Py_RETURN_NOTIMPLEMENTED;
#endif
}
// handle special methods

View File

@ -3077,6 +3077,11 @@ class BasicTest(unittest.TestCase):
# fallback to __rmul__ for not implemented __mul__
def test_90(self):
# skip this test for Python 2
if sys.version_info < (3, 0):
return
class RMulObject:
def __init__(self, factor):
self.factor = factor