Python 2.0 is not supposed to use string exceptions in the standard library

& extensions, so create exceptions in extension modules using the
PyErr_NewException() API.
This commit is contained in:
Fred Drake 2000-07-06 19:38:49 +00:00
parent 28067821e2
commit 589c35bcc7
3 changed files with 3 additions and 3 deletions

View File

@ -2329,7 +2329,7 @@ init_curses()
ModDict = d; /* For PyCurses_InitScr */
/* For exception curses.error */
PyCursesError = PyString_FromString("_curses.error");
PyCursesError = PyErr_NewException("_curses.error", NULL, NULL);
PyDict_SetItemString(d, "error", PyCursesError);
/* Make the version available */

View File

@ -2195,7 +2195,7 @@ inital()
/* Add some symbolic constants to the module */
d = PyModule_GetDict(m);
ErrorObject = PyString_FromString("al.error");
ErrorObject = PyErr_NewException("al.error", NULL, NULL);
PyDict_SetItemString(d, "error", ErrorObject);
/* XXXX Add constants here */

View File

@ -654,7 +654,7 @@ initpcre()
/* Add some symbolic constants to the module */
d = PyModule_GetDict(m);
ErrorObject = PyString_FromString("pcre.error");
ErrorObject = PyErr_NewException("pcre.error", NULL, NULL);
PyDict_SetItemString(d, "error", ErrorObject);
/* Insert the flags */