New exception interface
This commit is contained in:
parent
d2c0ec78d2
commit
55e3927f58
|
@ -606,13 +606,9 @@ initctb()
|
||||||
CMCONST("cmStatusListenPend", 0x2000);
|
CMCONST("cmStatusListenPend", 0x2000);
|
||||||
CMCONST("cmStatusIncomingCallPresent", 0x4000);
|
CMCONST("cmStatusIncomingCallPresent", 0x4000);
|
||||||
|
|
||||||
ErrorObject = PyString_FromString("ctb.error");
|
ErrorObject = PyErr_NewException("ctb.error", NULL, NULL);
|
||||||
PyDict_SetItemString(d, "error", ErrorObject);
|
PyDict_SetItemString(d, "error", ErrorObject);
|
||||||
ctbcmtype.ob_type = &PyType_Type;
|
ctbcmtype.ob_type = &PyType_Type;
|
||||||
Py_INCREF(&ctbcmtype);
|
Py_INCREF(&ctbcmtype);
|
||||||
PyDict_SetItemString(d, "CTBConnectionMgrType", (PyObject *)&ctbcmtype);
|
PyDict_SetItemString(d, "CTBConnectionMgrType", (PyObject *)&ctbcmtype);
|
||||||
|
|
||||||
/* Check for errors */
|
|
||||||
if (PyErr_Occurred())
|
|
||||||
Py_FatalError("can't initialize module ctb");
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -979,7 +979,7 @@ initmacfs()
|
||||||
|
|
||||||
/* 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("macfs.error");
|
ErrorObject = PyErr_NewException("macfs.error", NULL, NULL);
|
||||||
PyDict_SetItemString(d, "error", ErrorObject);
|
PyDict_SetItemString(d, "error", ErrorObject);
|
||||||
|
|
||||||
Mfsatype.ob_type = &PyType_Type;
|
Mfsatype.ob_type = &PyType_Type;
|
||||||
|
@ -992,8 +992,4 @@ initmacfs()
|
||||||
Py_INCREF(&Mfsitype);
|
Py_INCREF(&Mfsitype);
|
||||||
PyDict_SetItemString(d, "FInfoType", (PyObject *)&Mfsitype);
|
PyDict_SetItemString(d, "FInfoType", (PyObject *)&Mfsitype);
|
||||||
/* XXXX Add constants here */
|
/* XXXX Add constants here */
|
||||||
|
|
||||||
/* Check for errors */
|
|
||||||
if (PyErr_Occurred())
|
|
||||||
Py_FatalError("can't initialize module macfs");
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -630,7 +630,6 @@ initmac()
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
|
|
||||||
/* Initialize mac.error exception */
|
/* Initialize mac.error exception */
|
||||||
MacError = PyString_FromString("mac.error");
|
MacError = PyErr_NewException("mac.error", NULL, NULL);
|
||||||
if (MacError == NULL || PyDict_SetItemString(d, "error", MacError) != 0)
|
PyDict_SetItemString(d, "error", MacError);
|
||||||
Py_FatalError("can't define mac.error");
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -541,10 +541,6 @@ initmacspeech()
|
||||||
|
|
||||||
/* Add some symbolic constants to the module */
|
/* Add some symbolic constants to the module */
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
ms_error_object = PyString_FromString("macspeech.error");
|
ms_error_object = PyErr_NewException("macspeech.error", NULL, NULL);
|
||||||
PyDict_SetItemString(d, "error", ms_error_object);
|
PyDict_SetItemString(d, "error", ms_error_object);
|
||||||
|
|
||||||
/* Check for errors */
|
|
||||||
if (PyErr_Occurred())
|
|
||||||
Py_FatalError("can't initialize module macspeech");
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue