Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 58fb905

Browse files
committed
Fix a probable merge glitch in r66695:
a redundant check that actually belongs to another function.
1 parent c9e435e commit 58fb905

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Modules/_stringio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ stringio_read(StringIOObject *self, PyObject *args)
140140

141141
if (PyLong_Check(arg)) {
142142
size = PyLong_AsSsize_t(arg);
143+
if (size == -1 && PyErr_Occurred())
144+
return NULL;
143145
}
144146
else if (arg == Py_None) {
145147
/* Read until EOF is reached, by default. */
@@ -179,8 +181,6 @@ stringio_truncate(StringIOObject *self, PyObject *args)
179181
size = PyLong_AsSsize_t(arg);
180182
if (size == -1 && PyErr_Occurred())
181183
return NULL;
182-
if (size == -1 && PyErr_Occurred())
183-
return NULL;
184184
}
185185
else if (arg == Py_None) {
186186
/* Truncate to current position if no argument is passed. */

0 commit comments

Comments
 (0)