summaryrefslogtreecommitdiffstats
path: root/Modules/_stringio.c
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-09-30 20:22:44 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-09-30 20:22:44 (GMT)
commit58fb905ad08ef8dcea8c636755d0441f33c2b655 (patch)
treeecb0f7b5d7a07abc2718f80e11afc9eaad49c649 /Modules/_stringio.c
parentc9e435ee2b3e9fc883799480ad1fdb506c8f6a3f (diff)
downloadcpython-58fb905ad08ef8dcea8c636755d0441f33c2b655.zip
cpython-58fb905ad08ef8dcea8c636755d0441f33c2b655.tar.gz
cpython-58fb905ad08ef8dcea8c636755d0441f33c2b655.tar.bz2
Fix a probable merge glitch in r66695:
a redundant check that actually belongs to another function.
Diffstat (limited to 'Modules/_stringio.c')
-rw-r--r--Modules/_stringio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_stringio.c b/Modules/_stringio.c
index d29fe64..f342048 100644
--- a/Modules/_stringio.c
+++ b/Modules/_stringio.c
@@ -140,6 +140,8 @@ stringio_read(StringIOObject *self, PyObject *args)
if (PyLong_Check(arg)) {
size = PyLong_AsSsize_t(arg);
+ if (size == -1 && PyErr_Occurred())
+ return NULL;
}
else if (arg == Py_None) {
/* Read until EOF is reached, by default. */
@@ -179,8 +181,6 @@ stringio_truncate(StringIOObject *self, PyObject *args)
size = PyLong_AsSsize_t(arg);
if (size == -1 && PyErr_Occurred())
return NULL;
- if (size == -1 && PyErr_Occurred())
- return NULL;
}
else if (arg == Py_None) {
/* Truncate to current position if no argument is passed. */