Antoine Pitrou <pit...@free.fr> added the comment:

> aaugustin <aymeric.augus...@polyconseil.fr> added the comment:
> 
> I agree with your solution. Unfortunately, I do not know how you would
> redefine ThreadError to extend RuntimeError in a C extension.
> 
> _thread.error is created line 741 in trunk/Modules/threadmodule.c:
> ThreadError = PyErr_NewException("thread.error", NULL, NULL);

I was not proposing to extend it, just to alias it:

ThreadError = PyExc_RuntimeError;
Py_INCREF(ThreadError);

That said, extending is quite trivial if the behaviour is not changed:

ThreadError = PyErr_NewException("thread.error", PyExc_RuntimeError,
NULL);

(see
http://docs.python.org/dev/c-api/exceptions.html#PyErr_NewException)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11140>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to