[Python-3000-checkins] r60439 - python/branches/py3k/Objects/stringobject.c
christian.heimes
python-3000-checkins at python.org
Wed Jan 30 12:28:29 CET 2008
Author: christian.heimes
Date: Wed Jan 30 12:28:29 2008
New Revision: 60439
Modified:
python/branches/py3k/Objects/stringobject.c
Log:
Fixed issue #1973: bytes.fromhex('') raises SystemError
Modified: python/branches/py3k/Objects/stringobject.c
==============================================================================
--- python/branches/py3k/Objects/stringobject.c (original)
+++ python/branches/py3k/Objects/stringobject.c Wed Jan 30 12:28:29 2008
@@ -2772,7 +2772,7 @@
}
buf[j++] = (top << 4) + bot;
}
- if (_PyString_Resize(&newstring, j) < 0)
+ if (j != byteslen && _PyString_Resize(&newstring, j) < 0)
goto error;
return newstring;
@@ -2788,7 +2788,7 @@
return Py_BuildValue("(s#)", v->ob_sval, Py_SIZE(v));
}
-
+
static PyMethodDef
string_methods[] = {
{"__getnewargs__", (PyCFunction)string_getnewargs, METH_NOARGS},
More information about the Python-3000-checkins
mailing list