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:
parent
f56ccc1643
commit
697e07ad38
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user