8000 bpo-37207: Apply code review · python/cpython@1621285 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1621285

Browse files
committed
bpo-37207: Apply code review
1 parent b6c7b1f commit 1621285

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Objects/setobject.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2018,8 +2018,9 @@ static PyObject*
20182018
set_vectorcall(PyObject *type, PyObject * const*args,
20192019
size_t nargsf, PyObject *kwnames)
20202020
{
2021-
if (kwnames && PyTuple_GET_SIZE(kwnames) != 0) {
2022-
PyErr_Format(PyExc_TypeError, "set() takes no keyword arguments");
2021+
assert(PyType_Check(type));
2022+
2023+
if (!_PyArg_NoKwnames("set", kwnames)) {
20232024
return NULL;
20242025
}
20252026

@@ -2028,8 +2029,6 @@ set_vectorcall(PyObject *type, PyObject * const*args,
20282029
return NULL;
20292030
}
20302031

2031-
assert(PyType_Check(type));
2032-
20332032
if (nargs) {
20342033
return make_new_set((PyTypeObject *)type, args[0]);
20352034
}

0 commit comments

Comments
 (0)
0