add a test for bad atexit arguments
diff --git a/Lib/test/test_atexit.py b/Lib/test/test_atexit.py
index 6856042..04af9fb 100644
--- a/Lib/test/test_atexit.py
+++ b/Lib/test/test_atexit.py
@@ -44,6 +44,10 @@
         self.assertEqual(self.stream.getvalue(),
                             "h4 (4,) {'kw': 'abc'}\nh4 () {}\nh1\n")
 
+    def test_badargs(self):
+        atexit.register(lambda: 1, 0, 0, (x for x in (1,2)), 0, 0)
+        self.assertRaises(TypeError, atexit._run_exitfuncs)
+
     def test_order(self):
         # be sure handlers are executed in reverse order
         atexit.register(h1)