allow longs as indexes to group() (closes #22530)
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index 7bdf353..3c77948 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -971,6 +971,10 @@
             pat.split(string='abracadabra', maxsplit=1),
             ['', 'ab', 'racadabra'])
 
+    def test_match_group_takes_long(self):
+        self.assertEqual(re.match("(foo)", "foo").group(1L), "foo")
+        self.assertRaises(IndexError, re.match("", "").group, sys.maxint + 1)
+
 
 def run_re_tests():
     from test.re_tests import tests, SUCCEED, FAIL, SYNTAX_ERROR