Skip to content

Commit f585253

Browse files
committed
Only check for duplicates if there is at least one positional pattern
1 parent a2fa0a8 commit f585253

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/ceval.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ _PyEval_MatchClass(PyThreadState *tstate, PyObject *subject, PyObject *type,
751751
}
752752
// So far so good:
753753
PyObject *seen = NULL;
754-
if (nattrs > 1) {
754+
if (nargs > 0 && nattrs > 1) {
755755
seen = PySet_New(NULL);
756756
if (seen == NULL) {
757757
return NULL;

0 commit comments

Comments
 (0)