& extensions, so create exceptions in extension modules using the
PyErr_NewException() API.
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 */
/* 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 */
/* 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 */