checking what atexit handlers are registered in Python 3
Hi All, I'm finally getting around to porting some of the packages I maintain over to Python 3. One rough edge I've hit: I see the atexit module has moved to be C-based and, as far as I can tell, no longer allows you to introspect what atexit functions have been registered. If I'm writing tests for code that registers atexit handlers, how can I check that they've been correctly registered? cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk
On Feb 10, 2013, at 10:36 AM, Chris Withers wrote:
One rough edge I've hit: I see the atexit module has moved to be C-based and, as far as I can tell, no longer allows you to introspect what atexit functions have been registered.
If I'm writing tests for code that registers atexit handlers, how can I check that they've been correctly registered?
Looks like you can't through the atexit module. Even though Python 2's atexit._exithandlers is a private, undocumented attribute, the lack of an introspection API in Python 3's atexit seems like a functional regression. Please file a bug, although it will have to be a new feature for Python 3.4. Cheers, -Barry
participants (2)
-
Barry Warsaw -
Chris Withers