Skip to content

Commit 8bdd6f5

Browse files
committed
Use a more portable way to get the version string in PostgresNode
Older versions of perl on Windows don't like the list form of pipe open, and perlcritic doesn't like the string form of open, so we avoid both with a simpler formulation using qx{}. Per complaint from Amit Kapila.
1 parent 413c1ef commit 8bdd6f5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/test/perl/PostgresNode.pm

+2-4
Original file line numberDiff line numberDiff line change
@@ -1248,10 +1248,8 @@ sub _set_pg_version
12481248
local %ENV = $self->_get_env();
12491249

12501250
# We only want the version field
1251-
open my $fh, "-|", $pg_config, "--version"
1252-
or BAIL_OUT("$pg_config failed: $!");
1253-
my $version_line = <$fh>;
1254-
close $fh or die;
1251+
my $version_line = qx{$pg_config --version};
1252+
BAIL_OUT("$pg_config failed: $!") if $?;
12551253

12561254
$self->{_pg_version} = PostgresVersion->new($version_line);
12571255

0 commit comments

Comments
 (0)