This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients aymeric.augustin, gregory.p.smith, pitrou
Date 2011-02-07.16:11:20
SpamBayes Score 6.151602e-05
Marked as misclassified No
Message-id <1297095077.3754.26.camel@localhost.localdomain>
In-reply-to <1297094147.88.0.0267877269744.issue11140@psf.upfronthosting.co.za>
Content
> 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)
History
Date User Action Args
2011-02-07 16:11:21pitrousetrecipients: + pitrou, gregory.p.smith, aymeric.augustin
2011-02-07 16:11:20pitroulinkissue11140 messages
2011-02-07 16:11:20pitroucreate