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
Library
-------
+- Issue #22530: Allow the ``group()`` method of regular expression match objects
+ to take a ``long`` as an index.
+
- Issue #22517: When a io.BufferedRWPair object is deallocated, clear its
weakrefs.
{
Py_ssize_t i;
- if (PyInt_Check(index))
+ if (PyInt_Check(index) || PyLong_Check(index))
return PyInt_AsSsize_t(index);
i = -1;