Message128133
> aaugustin <aymeric.augustin@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) |
|
Date |
User |
Action |
Args |
2011-02-07 16:11:21 | pitrou | set | recipients:
+ pitrou, gregory.p.smith, aymeric.augustin |
2011-02-07 16:11:20 | pitrou | link | issue11140 messages |
2011-02-07 16:11:20 | pitrou | create | |
|