Skip to content

Commit 2801fe1

Browse files
author
Michael W. Hudson
committed
Use PyList_CheckExact and PyTuple_CheckExact for checking whether
PySequence_Fast needs to do anything siginificant.
1 parent 18c7d98 commit 2801fe1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Objects/abstract.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1436,7 +1436,7 @@ PySequence_Fast(PyObject *v, const char *m)
14361436
if (v == NULL)
14371437
return null_error();
14381438

1439-
if (PyList_Check(v) || PyTuple_Check(v)) {
1439+
if (PyList_CheckExact(v) || PyTuple_CheckExact(v)) {
14401440
Py_INCREF(v);
14411441
return v;
14421442
}

0 commit comments

Comments
 (0)