Kaydet (Commit) 589c35bc authored tarafından Fred Drake's avatar Fred Drake

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.
üst 28067821
...@@ -2329,7 +2329,7 @@ init_curses() ...@@ -2329,7 +2329,7 @@ init_curses()
ModDict = d; /* For PyCurses_InitScr */ ModDict = d; /* For PyCurses_InitScr */
/* For exception curses.error */ /* For exception curses.error */
PyCursesError = PyString_FromString("_curses.error"); PyCursesError = PyErr_NewException("_curses.error", NULL, NULL);
PyDict_SetItemString(d, "error", PyCursesError); PyDict_SetItemString(d, "error", PyCursesError);
/* Make the version available */ /* Make the version available */
......
...@@ -2195,7 +2195,7 @@ inital() ...@@ -2195,7 +2195,7 @@ inital()
/* Add some symbolic constants to the module */ /* Add some symbolic constants to the module */
d = PyModule_GetDict(m); d = PyModule_GetDict(m);
ErrorObject = PyString_FromString("al.error"); ErrorObject = PyErr_NewException("al.error", NULL, NULL);
PyDict_SetItemString(d, "error", ErrorObject); PyDict_SetItemString(d, "error", ErrorObject);
/* XXXX Add constants here */ /* XXXX Add constants here */
......
...@@ -654,7 +654,7 @@ initpcre() ...@@ -654,7 +654,7 @@ initpcre()
/* Add some symbolic constants to the module */ /* Add some symbolic constants to the module */
d = PyModule_GetDict(m); d = PyModule_GetDict(m);
ErrorObject = PyString_FromString("pcre.error"); ErrorObject = PyErr_NewException("pcre.error", NULL, NULL);
PyDict_SetItemString(d, "error", ErrorObject); PyDict_SetItemString(d, "error", ErrorObject);
/* Insert the flags */ /* Insert the flags */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment