[Python-checkins] r72315 - in python/branches/py3k: Lib/json/tests/test_scanstring.py Modules/_json.c
georg.brandl
python-checkins at python.org
Tue May 5 09:52:05 CEST 2009
Author: georg.brandl
Date: Tue May 5 09:52:05 2009
New Revision: 72315
Log:
Merged revisions 72314 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r72314 | georg.brandl | 2009-05-05 09:48:12 +0200 (Di, 05 Mai 2009) | 1 line
#5932: fix error return in _convertPyInt_AsSsize_t() conversion function.
........
Modified:
python/branches/py3k/Lib/json/tests/test_scanstring.py
python/branches/py3k/Modules/_json.c
Modified: python/branches/py3k/Lib/json/tests/test_scanstring.py
==============================================================================
--- python/branches/py3k/Lib/json/tests/test_scanstring.py (original)
+++ python/branches/py3k/Lib/json/tests/test_scanstring.py Tue May 5 09:52:05 2009
@@ -102,3 +102,6 @@
self.assertEquals(
scanstring('["Bad value", truth]', 2, True),
('Bad value', 12))
+
+ def test_overflow(self):
+ self.assertRaises(OverflowError, json.decoder.scanstring, b"xxx", sys.maxsize+1)
Modified: python/branches/py3k/Modules/_json.c
==============================================================================
--- python/branches/py3k/Modules/_json.c (original)
+++ python/branches/py3k/Modules/_json.c Tue May 5 09:52:05 2009
@@ -133,9 +133,9 @@
{
/* PyObject to Py_ssize_t converter */
*size_ptr = PyLong_AsSsize_t(o);
- if (*size_ptr == -1 && PyErr_Occurred());
- return 1;
- return 0;
+ if (*size_ptr == -1 && PyErr_Occurred())
+ return 0;
+ return 1;
}
static PyObject *
More information about the Python-checkins
mailing list