Skip to content

Commit 685a6c4

Browse files
committed
address review: s_new
1 parent f1388ee commit 685a6c4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/_struct.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1797,7 +1797,7 @@ s_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
17971797
{
17981798
PyStructObject *self;
17991799

1800-
if (PyTuple_GET_SIZE(args) != 1 || kwds) {
1800+
if (PyTuple_GET_SIZE(args) != 1) {
18011801
if (PyErr_WarnEx(PyExc_DeprecationWarning,
18021802
"Struct.__new__() has one positional argument", 1)) {
18031803
return NULL;
@@ -1815,7 +1815,7 @@ s_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
18151815
self->s_size = -1;
18161816
self->s_len = -1;
18171817
self->init_called = false;
1818-
if (PyTuple_GET_SIZE(args) > 0) {
1818+
if (PyTuple_GET_SIZE(args) == 1) {
18191819
if (s_init(self, PyTuple_GET_ITEM(args, 0))) {
18201820
Py_DECREF(self);
18211821
return NULL;

0 commit comments

Comments
 (0)