python: The right exception is called, WmfsInitError instead of error.

a wmfs.WmfsInitError is available with a wmfs.WmfsInitError.message containing message error.

In [2]: wmfs.init()
---------------------------------------------------------------------------
WmfsInitError                             Traceback (most recent call last)

/usr/home/marc/<ipython console> in <module>()

WmfsInitError: WMFS not running?

In [3]: try:
   ...:     wmfs.init()
   ...: except wmfs.WmfsInitError, e:
   ...:     print 'Error: '+e.message
   ...:
Error: WMFS not running?

Signed-off-by: Marc Lagrange <marc@shebang.sangor>
This commit is contained in:
Marc Lagrange 2009-01-09 13:34:08 +01:00
parent f56ccc1643
commit 697e07ad38

View File

@ -189,10 +189,10 @@ initwmfs(void)
if(m == NULL)
return;
WmfsInitError = PyErr_NewException("wmfs.error", NULL, NULL);
WmfsInitError = PyErr_NewException("wmfs.WmfsInitError", NULL, NULL);
Py_INCREF(WmfsInitError);
PyModule_AddObject(m, "error", WmfsInitError);
PyModule_AddObject(m, "WmfsInitError", WmfsInitError);
}
int