[2.7] bpo-31243: Fixed PyArg_ParseTuple failure checks. (GH-3171) (#3235)
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c
index f13dcb4..d9e036d 100644
--- a/Modules/_io/textio.c
+++ b/Modules/_io/textio.c
@@ -1416,7 +1416,7 @@
/* Given this, we know there was a valid snapshot point
* len(dec_buffer) bytes ago with decoder state (b'', dec_flags).
*/
- if (PyArg_Parse(state, "(OO)", &dec_buffer, &dec_flags) < 0) {
+ if (!PyArg_Parse(state, "(OO)", &dec_buffer, &dec_flags)) {
Py_DECREF(state);
return -1;
}