py api was raising SystemError exception incorrectly, this is intended for internal interpreter problems.

Replace most with RuntimeError.
This commit is contained in:
2011-02-18 06:04:05 +00:00
parent 1dc4db7775
commit 6524d27462
8 changed files with 33 additions and 33 deletions

View File

@@ -78,7 +78,7 @@ void PyC_FileAndNum(const char **filename, int *lineno)
if (filename) {
co_filename= PyC_Object_GetAttrStringArgs(frame, 2, "f_code", "co_filename");
if (co_filename==NULL) {
PyErr_SetString(PyExc_SystemError, "Could not access sys._getframe().f_code.co_filename");
PyErr_SetString(PyExc_RuntimeError, "Could not access sys._getframe().f_code.co_filename");
Py_DECREF(frame);
return;
}
@@ -109,7 +109,7 @@ void PyC_FileAndNum(const char **filename, int *lineno)
if (lineno) {
f_lineno= PyObject_GetAttrString(frame, "f_lineno");
if (f_lineno==NULL) {
PyErr_SetString(PyExc_SystemError, "Could not access sys._getframe().f_lineno");
PyErr_SetString(PyExc_RuntimeError, "Could not access sys._getframe().f_lineno");
Py_DECREF(frame);
return;
}