Skip to content

Commit 1eb2472

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 af9e0d5 commit 1eb2472

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
@@ -258,10 +258,10 @@ sub mangle_plpython3
258258
my @files = glob("$dir/$test.$extension $dir/${test}_[0-9].$extension");
259259
foreach my $file (@files)
260260
{
261-
open(my $handle, "$file") || die "test file $file not found";
261+
open(my $handle, '<', $file) || die "test file $file not found";
262262
my $contents = <$handle>;
263263
close($handle);
264-
map
264+
do
265265
{
266266
s/except ([[:alpha:]][[:alpha:].]*), *([[:alpha:]][[:alpha:]]*):/except $1 as $2:/g;
267267
s/<type 'exceptions\.([[:alpha:]]*)'>/<class '$1'>/g;
@@ -273,15 +273,16 @@ sub mangle_plpython3
273273
s/LANGUAGE plpython2?u/LANGUAGE plpython3u/g;
274274
s/EXTENSION ([^ ]*_)*plpython2?u/EXTENSION $1plpython3u/g;
275275
s/installing required extension "plpython2u"/installing required extension "plpython3u"/g;
276-
} $contents;
276+
} for ($contents);
277277
my $base = basename $file;
278-
open($handle, ">$dir/python3/$base") || die "opening python 3 file for $file";
278+
open($handle, '>', "$dir/python3/$base") ||
279+
die "opening python 3 file for $file";
279280
print $handle $contents;
280281
close($handle);
281282
}
282283
}
283284
}
284-
map { $_ =~ s!^!python3/!; } @$tests;
285+
do { s!^!python3/!; } foreach(@$tests);
285286
return @$tests;
286287
}
287288

0 commit comments

Comments
 (0)