Skip to content

Commit 9f3b268

Browse files
committed
Allow regex matching on arrays
1 parent 47bb774 commit 9f3b268

File tree

2 files changed

+3
-1
lines changed
  • graalpython

2 files changed

+3
-1
lines changed

graalpython/com.oracle.graal.python.test/src/tests/unittest_tags/test_re.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
*graalpython.lib-python.3.test.test_re.ReTests.test_constants
4343
*graalpython.lib-python.3.test.test_re.ReTests.test_debug_flag
4444
*graalpython.lib-python.3.test.test_re.ReTests.test_dollar_matches_twice
45+
*graalpython.lib-python.3.test.test_re.ReTests.test_empty_array
4546
*graalpython.lib-python.3.test.test_re.ReTests.test_enum
4647
*graalpython.lib-python.3.test.test_re.ReTests.test_error
4748
*graalpython.lib-python.3.test.test_re.ReTests.test_flags

graalpython/lib-graalpython/_sre.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
# SOFTWARE.
3939

4040
from mmap import mmap
41+
from array import array
4142

4243
_mappingproxy = type(type.__dict__)
4344

@@ -265,7 +266,7 @@ def _append_end_assert(pattern):
265266
return pattern if pattern.endswith(rb"\Z") else pattern + rb"\Z"
266267

267268
def _is_bytes_like(object):
268-
return isinstance(object, (bytes, bytearray, memoryview, mmap))
269+
return isinstance(object, (bytes, bytearray, memoryview, array, mmap))
269270

270271
class Pattern():
271272
def __init__(self, pattern, flags):

0 commit comments

Comments
 (0)