Issue #20510: Confirm that the code attribute of the SystemExit
exception raised by sys.exit is None when no code is given.

As suggested by Serhiy Storchaka.
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index 491ae9c..f768e9b 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -91,6 +91,10 @@
         self.assertRaises(TypeError, sys.exit, 42, 42)
 
         # call without argument
+        with self.assertRaises(SystemExit) as cm:
+            sys.exit()
+        self.assertIsNone(cm.exception.code)
+
         rc, out, err = assert_python_ok('-c', 'import sys; sys.exit()')
         self.assertEqual(rc, 0)
         self.assertEqual(out, b'')