Benjamin Peterson wound up writing a test case for the new C atexit module on the py3k branch. A similar test, though different in detail, makes sense for the Python atexit module on trunk. Is this something I can check in or should I just wait until after 2.6 is released? def test_badargs(self): s = StringIO.StringIO() sys.stdout = sys.stderr = s save_handlers = atexit._exithandlers atexit._exithandlers = [] try: atexit.register(lambda: 1, 0, 0, (x for x in (1,2)), 0, 0) self.assertRaises(TypeError, atexit._run_exitfuncs) finally: sys.stdout = sys.__stdout__ sys.stderr = sys.__stderr__ atexit._exithandlers = save_handlers Thx, Skip