Skip to content

Commit 2b9bdda

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 d160882 commit 2b9bdda

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
@@ -264,10 +264,10 @@ sub mangle_plpython3
264264
my @files = glob("$dir/$test.$extension $dir/${test}_[0-9].$extension");
265265
foreach my $file (@files)
266266
{
267-
open(my $handle, "$file") || die "test file $file not found";
267+
open(my $handle, '<', $file) || die "test file $file not found";
268268
my $contents = <$handle>;
269269
close($handle);
270-
map
270+
do
271271
{
272272
s/except ([[:alpha:]][[:alpha:].]*), *([[:alpha:]][[:alpha:]]*):/except $1 as $2:/g;
273273
s/<type 'exceptions\.([[:alpha:]]*)'>/<class '$1'>/g;
@@ -279,15 +279,16 @@ sub mangle_plpython3
279279
s/LANGUAGE plpython2?u/LANGUAGE plpython3u/g;
280280
s/EXTENSION ([^ ]*_)*plpython2?u/EXTENSION $1plpython3u/g;
281281
s/installing required extension "plpython2u"/installing required extension "plpython3u"/g;
282-
} $contents;
282+
} for ($contents);
283283
my $base = basename $file;
284-
open($handle, ">$dir/python3/$base") || die "opening python 3 file for $file";
284+
open($handle, '>', "$dir/python3/$base") ||
285+
die "opening python 3 file for $file";
285286
print $handle $contents;
286287
close($handle);
287288
}
288289
}
289290
}
290-
map { $_ =~ s!^!python3/!; } @$tests;
291+
do { s!^!python3/!; } foreach(@$tests);
291292
return @$tests;
292293
}
293294

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy