diff options
author | Andrew Dunstan <andrew@dunslane.net> | 2018-05-06 07:37:05 -0400 |
---|---|---|
committer | Andrew Dunstan <andrew@dunslane.net> | 2018-05-06 07:39:05 -0400 |
commit | 0e6114be8c2d0bb0951f1b24e186723d9190fa1c (patch) | |
tree | d20f73fda87d6d5d107cc7eeb6d6cdc132eec3f0 | |
parent | 8f1787a8f3f3584c70255372c1034d8990eaed9b (diff) | |
download | postgresql-0e6114be8c2d0bb0951f1b24e186723d9190fa1c.tar.gz |
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.
-rw-r--r-- | src/tools/msvc/vcregress.pl | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl index d60655a521..d4f61c7b3f 100644 --- a/src/tools/msvc/vcregress.pl +++ b/src/tools/msvc/vcregress.pl @@ -262,10 +262,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; @@ -277,15 +277,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; } |