Commit f75d60a 1 parent 8447c99 commit f75d60a Copy full SHA for f75d60a
File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ def sep(s):
270
270
"""Find the path separator used in this string, or os.sep if none."""
271
271
sep_match = re .search (r"[\\/]" , s )
272
272
if sep_match :
273
- the_sep = sep_match . group ( 0 )
273
+ the_sep = sep_match [ 0 ]
274
274
else :
275
275
the_sep = os .sep
276
276
return the_sep
@@ -387,7 +387,7 @@ def map(self, path):
387
387
for regex , result in self .aliases :
388
388
m = regex .match (path )
389
389
if m :
390
- new = path .replace (m . group ( 0 ) , result )
390
+ new = path .replace (m [ 0 ] , result )
391
391
new = new .replace (sep (path ), sep (result ))
392
392
if not self .relative :
393
393
new = canonical_filename (new )
Original file line number Diff line number Diff line change @@ -324,17 +324,17 @@ def substitute_variables(text, variables):
324
324
325
325
def dollar_replace (match ):
326
326
"""Called for each $replacement."""
327
- # Only one of the groups will have matched, just get its text.
327
+ # Only one of the dollar_groups will have matched, just get its text.
328
328
word = next (g for g in match .group (* dollar_groups ) if g ) # pragma: always breaks
329
329
if word == "$" :
330
330
return "$"
331
331
elif word in variables :
332
332
return variables [word ]
333
- elif match . group ( 'strict' ) :
333
+ elif match [ 'strict' ] :
334
334
msg = f"Variable { word } is undefined: { text !r} "
335
335
raise CoverageException (msg )
336
336
else :
337
- return match . group ( 'defval' )
337
+ return match [ 'defval' ]
338
338
339
339
text = re .sub (dollar_pattern , dollar_replace , text )
340
340
return text
You can’t perform that action at this time.
0 commit comments