Skip to content

Commit 7cf0016

Browse files
committed
Fix test_exceptions
1 parent 2646724 commit 7cf0016

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

Objects/exceptions.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,17 @@ BaseException_vectorcall(PyObject *type_obj, PyObject * const*args,
8484
size_t nargsf, PyObject *kwnames)
8585
{
8686
PyTypeObject *type = _PyType_CAST(type_obj);
87-
PyBaseExceptionObject *self;
87+
if (!_PyArg_NoKwnames(type->tp_name, kwnames)) {
88+
return NULL;
89+
}
8890

91+
PyBaseExceptionObject *self;
8992
self = (PyBaseExceptionObject *)type->tp_alloc(type, 0);
90-
if (!self)
93+
if (!self) {
9194
return NULL;
92-
/* the dict is created on the fly in PyObject_GenericSetAttr */
95+
}
96+
97+
// The dict is created on the fly in PyObject_GenericSetAttr()
9398
self->dict = NULL;
9499
self->notes = NULL;
95100
self->traceback = self->cause = self->context = NULL;

0 commit comments

Comments
 (0)