Skip to content

Commit 0e6114b

Browse files
committed
Clear severity 5 perlcritic warnings from vcregress.pl
My recent update for python3 support used some idioms that are unapproved. This fixes them. Backpatch to all live branches like the original.
1 parent 8f1787a commit 0e6114b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/tools/msvc/vcregress.pl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,10 @@ sub mangle_plpython3
262262
my @files = glob("$dir/$test.$extension $dir/${test}_[0-9].$extension");
263263
foreach my $file (@files)
264264
{
265-
open(my $handle, "$file") || die "test file $file not found";
265+
open(my $handle, '<', $file) || die "test file $file not found";
266266
my $contents = <$handle>;
267267
close($handle);
268-
map
268+
do
269269
{
270270
s/except ([[:alpha:]][[:alpha:].]*), *([[:alpha:]][[:alpha:]]*):/except $1 as $2:/g;
271271
s/<type 'exceptions\.([[:alpha:]]*)'>/<class '$1'>/g;
@@ -277,15 +277,16 @@ sub mangle_plpython3
277277
s/LANGUAGE plpython2?u/LANGUAGE plpython3u/g;
278278
s/EXTENSION ([^ ]*_)*plpython2?u/EXTENSION $1plpython3u/g;
279279
s/installing required extension "plpython2u"/installing required extension "plpython3u"/g;
280-
} $contents;
280+
} for ($contents);
281281
my $base = basename $file;
282-
open($handle, ">$dir/python3/$base") || die "opening python 3 file for $file";
282+
open($handle, '>', "$dir/python3/$base") ||
283+
die "opening python 3 file for $file";
283284
print $handle $contents;
284285
close($handle);
285286
}
286287
}
287288
}
288-
map { $_ =~ s!^!python3/!; } @$tests;
289+
do { s!^!python3/!; } foreach(@$tests);
289290
return @$tests;
290291
}
291292

0 commit comments

Comments
 (0)