Author vstinner
Recipients vstinner
Date 2008-08-22.01:41:19
SpamBayes Score 0.00586267
Marked as misclassified No
Message-id <1219369283.37.0.028447493951.issue3643@psf.upfronthosting.co.za>
In-reply-to
Content
test_thread_state() doesn't check that the argument is a function and 
doesn't check function call result and so the exception is catched 
later:

Non callable argument:
   import _testcapi
   _testcapi._test_thread_state(10)
   # no exception raise here
   import gc
   # exception raised too late!
=> TypeError: 'int' object is not callable

Callback error:
   import _testcapi
   def err():
      raise ValueError("xxx")
   _testcapi._test_thread_state(err)
   # no exception raise here
   import gc
   # exception raised too late!
=> ValueError: xxx

So I wrote a patch which fixes that but also raise_exception() which 
have to check that the argument is an exception class.
History
Date User Action Args
2008-08-22 01:41:23vstinnersetrecipients: + vstinner
2008-08-22 01:41:23vstinnersetmessageid: <1219369283.37.0.028447493951.issue3643@psf.upfronthosting.co.za>
2008-08-22 01:41:22vstinnerlinkissue3643 messages
2008-08-22 01:41:21vstinnercreate