Skip to content

Commit 743686a

Browse files
committed
Fix output conversion of Match.group
1 parent e1928f1 commit 743686a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

graalpython/lib-graalpython/_sre.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,10 @@ def __group(self, idx, default=None):
204204
start = self.__result.getStart(idxarg)
205205
if start < 0:
206206
return default
207-
else:
207+
elif isinstance(self.__input_str, str):
208208
return self.__input_str[start:self.__result.getEnd(idxarg)]
209+
else:
210+
return bytes(self.__input_str[start:self.__result.getEnd(idxarg)])
209211

210212
def groupdict(self, default=None):
211213
groups = self.__compiled_regex.groups

0 commit comments

Comments
 (0)