Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use RuntimeError
  • Loading branch information
encukou committed Jun 10, 2022
commit d115147bf3577ae6051e4df4692a887e42b9f325
2 changes: 1 addition & 1 deletion Lib/test/test_capi.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ def test_heaptype_with_custom_metaclass(self):
def test_pytype_fromspec_with_repeated_slots(self):
for variant in range(2):
with self.subTest(variant=variant):
with self.assertRaises(RuntimeError):
with self.assertRaises(SystemError):
_testcapi.create_type_from_repeated_slots(variant)

def test_pynumber_tobase(self):
Expand Down
4 changes: 2 additions & 2 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -3419,7 +3419,7 @@ PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module,
if (slot->slot == Py_tp_members) {
if (nmembers != 0) {
PyErr_SetString(
PyExc_RuntimeError,
PyExc_SystemError,
"Multiple Py_tp_members slots are not supported.");
return NULL;
}
Expand Down Expand Up @@ -3567,7 +3567,7 @@ PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module,
literal, we need to make a copy */
if (type->tp_doc != NULL) {
PyErr_SetString(
PyExc_RuntimeError,
PyExc_SystemError,
"Multiple Py_tp_doc slots are not supported.");
return NULL;
}
Expand Down