File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
com.oracle.graal.python.test/src/tests/unittest_tags Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 45
45
*graalpython.lib-python.3.test.test_re.ReTests.test_enum
46
46
*graalpython.lib-python.3.test.test_re.ReTests.test_error
47
47
*graalpython.lib-python.3.test.test_re.ReTests.test_flags
48
+ *graalpython.lib-python.3.test.test_re.ReTests.test_group
48
49
*graalpython.lib-python.3.test.test_re.ReTests.test_group_name_in_exception
49
50
*graalpython.lib-python.3.test.test_re.ReTests.test_groupdict
50
51
*graalpython.lib-python.3.test.test_re.ReTests.test_ignore_case
Original file line number Diff line number Diff line change @@ -191,10 +191,12 @@ def __getitem__(self, item):
191
191
192
192
def __groupidx (self , idx ):
193
193
try :
194
- if isinstance (idx , str ):
194
+ if hasattr (idx , '__index__' ):
195
+ int_idx = int (idx )
196
+ if 0 <= int_idx < self .__compiled_regex .groupCount :
197
+ return int_idx
198
+ else :
195
199
return self .__compiled_regex .groups [idx ]
196
- elif 0 <= idx < self .__compiled_regex .groupCount :
197
- return idx
198
200
except Exception :
199
201
pass
200
202
raise IndexError ("no such group" )
You can’t perform that action at this time.
0 commit comments