]> granicus.if.org Git - python/commitdiff
Python 2.0 is not supposed to use string exceptions in the standard library
authorFred Drake <fdrake@acm.org>
Thu, 6 Jul 2000 19:38:49 +0000 (19:38 +0000)
committerFred Drake <fdrake@acm.org>
Thu, 6 Jul 2000 19:38:49 +0000 (19:38 +0000)
& extensions, so create exceptions in extension modules using the
PyErr_NewException() API.

Modules/_cursesmodule.c
Modules/almodule.c
Modules/pcremodule.c

index f98f12e497417a203821ac96075afea66db91bd4..330f6a21d3d83659b32ceb250d9a593c3e969124 100644 (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 */
index 13c9ebc30563c54536f583f961513dc1b64022df..453a41618d5227722e9014fba02ea5d7ab305ca9 100644 (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 */
index 901f67480b5d2a70635f9bf6ffc310b3fd0fc476..6fb2d070172790e02f2843dbce2b5eefe320a50a 100644 (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 */