Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c9e435e commit 58fb905Copy full SHA for 58fb905
1 file changed
Modules/_stringio.c
@@ -140,6 +140,8 @@ stringio_read(StringIOObject *self, PyObject *args)
140
141
if (PyLong_Check(arg)) {
142
size = PyLong_AsSsize_t(arg);
143
+ if (size == -1 && PyErr_Occurred())
144
+ return NULL;
145
}
146
else if (arg == Py_None) {
147
/* Read until EOF is reached, by default. */
@@ -179,8 +181,6 @@ stringio_truncate(StringIOObject *self, PyObject *args)
179
181
180
182
if (size == -1 && PyErr_Occurred())
183
return NULL;
- if (size == -1 && PyErr_Occurred())
- return NULL;
184
185
186
/* Truncate to current position if no argument is passed. */
0 commit comments