aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2018-05-06 07:37:05 -0400
committerAndrew Dunstan <andrew@dunslane.net>2018-05-06 07:37:05 -0400
commit2b9bdda74485909a4a3067bf0ba3f0821e82660e (patch)
tree7d4aa2d4abf83b3f09bc9ce20bcf80682a952426 /src
parentd160882a17403d61bc04c5745493e027e60165ce (diff)
downloadpostgresql-2b9bdda74485909a4a3067bf0ba3f0821e82660e.tar.gz
postgresql-2b9bdda74485909a4a3067bf0ba3f0821e82660e.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/tools/msvc/vcregress.pl11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl
index 2b8341f4fc2..3a88638d705 100644
--- a/src/tools/msvc/vcregress.pl
+++ b/src/tools/msvc/vcregress.pl
@@ -264,10 +264,10 @@ sub mangle_plpython3
my @files = glob("$dir/$test.$extension $dir/${test}_[0-9].$extension");
foreach my $file (@files)
{
- open(my $handle, "$file") || die "test file $file not found";
+ open(my $handle, '<', $file) || die "test file $file not found";
my $contents = <$handle>;
close($handle);
- map
+ do
{
s/except ([[:alpha:]][[:alpha:].]*), *([[:alpha:]][[:alpha:]]*):/except $1 as $2:/g;
s/<type 'exceptions\.([[:alpha:]]*)'>/<class '$1'>/g;
@@ -279,15 +279,16 @@ sub mangle_plpython3
s/LANGUAGE plpython2?u/LANGUAGE plpython3u/g;
s/EXTENSION ([^ ]*_)*plpython2?u/EXTENSION $1plpython3u/g;
s/installing required extension "plpython2u"/installing required extension "plpython3u"/g;
- } $contents;
+ } for ($contents);
my $base = basename $file;
- open($handle, ">$dir/python3/$base") || die "opening python 3 file for $file";
+ open($handle, '>', "$dir/python3/$base") ||
+ die "opening python 3 file for $file";
print $handle $contents;
close($handle);
}
}
}
- map { $_ =~ s!^!python3/!; } @$tests;
+ do { s!^!python3/!; } foreach(@$tests);
return @$tests;
}