summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1997-10-07 21:47:25 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1997-10-07 21:47:25 (GMT)
commit55e3927f58b848f0c980158527270b172a7ac68b (patch)
tree10e85ee614d64cb37d3f86e8cbf61e188c09369d
parentd2c0ec78d20d5e4de34f87e273e6bfb5eb152987 (diff)
downloadcpython-55e3927f58b848f0c980158527270b172a7ac68b.zip
cpython-55e3927f58b848f0c980158527270b172a7ac68b.tar.gz
cpython-55e3927f58b848f0c980158527270b172a7ac68b.tar.bz2
New exception interface
-rw-r--r--Mac/Modules/ctbmodule.c6
-rw-r--r--Mac/Modules/macfsmodule.c6
-rw-r--r--Mac/Modules/macmodule.c5
-rw-r--r--Mac/Modules/macspeechmodule.c6
4 files changed, 5 insertions, 18 deletions
diff --git a/Mac/Modules/ctbmodule.c b/Mac/Modules/ctbmodule.c
index 6eabca9..bb6fd18 100644
--- a/Mac/Modules/ctbmodule.c
+++ b/Mac/Modules/ctbmodule.c
@@ -606,13 +606,9 @@ initctb()
CMCONST("cmStatusListenPend", 0x2000);
CMCONST("cmStatusIncomingCallPresent", 0x4000);
- ErrorObject = PyString_FromString("ctb.error");
+ ErrorObject = PyErr_NewException("ctb.error", NULL, NULL);
PyDict_SetItemString(d, "error", ErrorObject);
ctbcmtype.ob_type = &PyType_Type;
Py_INCREF(&ctbcmtype);
PyDict_SetItemString(d, "CTBConnectionMgrType", (PyObject *)&ctbcmtype);
-
- /* Check for errors */
- if (PyErr_Occurred())
- Py_FatalError("can't initialize module ctb");
}
diff --git a/Mac/Modules/macfsmodule.c b/Mac/Modules/macfsmodule.c
index 2c5af1e..2c0c8e1 100644
--- a/Mac/Modules/macfsmodule.c
+++ b/Mac/Modules/macfsmodule.c
@@ -979,7 +979,7 @@ initmacfs()
/* Add some symbolic constants to the module */
d = PyModule_GetDict(m);
- ErrorObject = PyString_FromString("macfs.error");
+ ErrorObject = PyErr_NewException("macfs.error", NULL, NULL);
PyDict_SetItemString(d, "error", ErrorObject);
Mfsatype.ob_type = &PyType_Type;
@@ -992,8 +992,4 @@ initmacfs()
Py_INCREF(&Mfsitype);
PyDict_SetItemString(d, "FInfoType", (PyObject *)&Mfsitype);
/* XXXX Add constants here */
-
- /* Check for errors */
- if (PyErr_Occurred())
- Py_FatalError("can't initialize module macfs");
}
diff --git a/Mac/Modules/macmodule.c b/Mac/Modules/macmodule.c
index 49c0f8b..a7f958e 100644
--- a/Mac/Modules/macmodule.c
+++ b/Mac/Modules/macmodule.c
@@ -630,7 +630,6 @@ initmac()
d = PyModule_GetDict(m);
/* Initialize mac.error exception */
- MacError = PyString_FromString("mac.error");
- if (MacError == NULL || PyDict_SetItemString(d, "error", MacError) != 0)
- Py_FatalError("can't define mac.error");
+ MacError = PyErr_NewException("mac.error", NULL, NULL);
+ PyDict_SetItemString(d, "error", MacError);
}
diff --git a/Mac/Modules/macspeechmodule.c b/Mac/Modules/macspeechmodule.c
index 22fe99a..d0ee465 100644
--- a/Mac/Modules/macspeechmodule.c
+++ b/Mac/Modules/macspeechmodule.c
@@ -541,10 +541,6 @@ initmacspeech()
/* Add some symbolic constants to the module */
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);
-
- /* Check for errors */
- if (PyErr_Occurred())
- Py_FatalError("can't initialize module macspeech");
}