Array module's buffer interface can now handle empty arrays.
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index a885180..f15ce09 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -604,6 +604,13 @@
self.assertEqual(iter.next().span(), (4, 4))
self.assertRaises(StopIteration, iter.next)
+ def test_empty_array(self):
+ # SF buf 1647541
+ import array
+ for typecode in 'cbBuhHiIlLfd':
+ a = array.array(typecode)
+ self.assertEqual(re.compile("bla").match(a), None)
+ self.assertEqual(re.compile("").match(a).groups(), ())
def run_re_tests():
from test.re_tests import benchmarks, tests, SUCCEED, FAIL, SYNTAX_ERROR