benjamin.peterson
2008-09-30 02:22:04 UTC
Author: benjamin.peterson
Date: Tue Sep 30 04:22:04 2008
New Revision: 66695
Log:
check for errors after PyLong_Ssize_t
patch from Victor Stinner #3977
reviewed by Amaury
Modified:
python/branches/py3k/Modules/_stringio.c
Modified: python/branches/py3k/Modules/_stringio.c
==============================================================================
--- python/branches/py3k/Modules/_stringio.c (original)
+++ python/branches/py3k/Modules/_stringio.c Tue Sep 30 04:22:04 2008
@@ -177,6 +177,10 @@
if (PyLong_Check(arg)) {
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. */
Date: Tue Sep 30 04:22:04 2008
New Revision: 66695
Log:
check for errors after PyLong_Ssize_t
patch from Victor Stinner #3977
reviewed by Amaury
Modified:
python/branches/py3k/Modules/_stringio.c
Modified: python/branches/py3k/Modules/_stringio.c
==============================================================================
--- python/branches/py3k/Modules/_stringio.c (original)
+++ python/branches/py3k/Modules/_stringio.c Tue Sep 30 04:22:04 2008
@@ -177,6 +177,10 @@
if (PyLong_Check(arg)) {
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. */