From: Vincent Pit Date: Tue, 14 Apr 2015 16:32:59 +0000 (-0300) Subject: Work around old IPC::Open3 reporting exceptions on STDERR X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=3edc6d15d41c3ff378ba461d7c218bc9a5c851f0;p=perl%2Fmodules%2FVPIT-TestHelpers.git Work around old IPC::Open3 reporting exceptions on STDERR --- diff --git a/lib/VPIT/TestHelpers.pm b/lib/VPIT/TestHelpers.pm index bae9785..e8cfa71 100644 --- a/lib/VPIT/TestHelpers.pm +++ b/lib/VPIT/TestHelpers.pm @@ -476,6 +476,15 @@ sub capture { 1; }; + if ("$]" < 5.014 and $ok and ($status >> 8) == 255 and defined $content_err + and $content_err =~ /^open3/) { + # Before perl commit 8960aa87 (between 5.12 and 5.14), exceptions in open3 + # could be reported to STDERR instead of being propagated, so work around + # this. + $ok = 0; + $@ = $content_err; + } + if ($ok) { return ($status, $content_out, $content_err); } else {