Skip to content

Commit bb52440

Browse files
committed
Fix incorrect type check in buffered_iternext()
The condition used Py_IS_TYPE(tp, ...) where tp is already a `type`, this made the fast path unreachable.
1 parent b625601 commit bb52440

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/_io/bufferedio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,8 +1505,8 @@ buffered_iternext(PyObject *op)
15051505

15061506
_PyIO_State *state = find_io_state_by_def(Py_TYPE(self));
15071507
tp = Py_TYPE(self);
1508-
if (Py_IS_TYPE(tp, state->PyBufferedReader_Type) ||
1509-
Py_IS_TYPE(tp, state->PyBufferedRandom_Type))
1508+
if (tp == state->PyBufferedReader_Type ||
1509+
tp == state->PyBufferedRandom_Type)
15101510
{
15111511
/* Skip method call overhead for speed */
15121512
line = _buffered_readline(self, -1);

0 commit comments

Comments
 (0)