Skip to content

Commit 50c01e5

Browse files
committed
Fix Match.__repr__
1 parent 743686a commit 50c01e5

File tree

2 files changed

+2
-1
lines changed
  • graalpython

2 files changed

+2
-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
@@ -56,6 +56,7 @@
5656
*graalpython.lib-python.3.test.test_re.ReTests.test_lookahead
5757
*graalpython.lib-python.3.test.test_re.ReTests.test_lookbehind
5858
*graalpython.lib-python.3.test.test_re.ReTests.test_match_getitem
59+
*graalpython.lib-python.3.test.test_re.ReTests.test_match_repr
5960
*graalpython.lib-python.3.test.test_re.ReTests.test_multiple_repeat
6061
*graalpython.lib-python.3.test.test_re.ReTests.test_not_literal
6162
*graalpython.lib-python.3.test.test_re.ReTests.test_nothing_to_repeat

graalpython/lib-graalpython/_sre.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def lastindex(self):
254254
return lastindex
255255

256256
def __repr__(self):
257-
return "<re.Match object; span=%r, match=%r>" % (self.span(), self.group())
257+
return "<%s object; span=%r, match=%r>" % (type(self).__name__, self.span(), self.group())
258258

259259
def _append_end_assert(pattern):
260260
if isinstance(pattern, str):

0 commit comments

Comments
 (0)