From: Fred Drake Date: Thu, 6 Jul 2000 19:38:49 +0000 (+0000) Subject: Python 2.0 is not supposed to use string exceptions in the standard library X-Git-Tag: v2.0b1~1043 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=589c35bcc7ee2448507cedf303e3b72ede34b6ce;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index f98f12e49741..330f6a21d3d8 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -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 */ diff --git a/Modules/almodule.c b/Modules/almodule.c index 13c9ebc30563..453a41618d52 100644 --- a/Modules/almodule.c +++ b/Modules/almodule.c @@ -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 */ diff --git a/Modules/pcremodule.c b/Modules/pcremodule.c index 901f67480b5d..6fb2d0701727 100644 --- a/Modules/pcremodule.c +++ b/Modules/pcremodule.c @@ -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 */