Use PyList_CheckExact and PyTuple_CheckExact for checking whether
PySequence_Fast needs to do anything siginificant.
This commit is contained in:
parent
18c7d98bd1
commit
2801fe1c8f
|
@ -1436,7 +1436,7 @@ PySequence_Fast(PyObject *v, const char *m)
|
||||||
if (v == NULL)
|
if (v == NULL)
|
||||||
return null_error();
|
return null_error();
|
||||||
|
|
||||||
if (PyList_Check(v) || PyTuple_Check(v)) {
|
if (PyList_CheckExact(v) || PyTuple_CheckExact(v)) {
|
||||||
Py_INCREF(v);
|
Py_INCREF(v);
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue