]> git.vpit.fr Git - perl/modules/VPIT-TestHelpers.git/commitdiff
Work around old IPC::Open3 reporting exceptions on STDERR
authorVincent Pit <vince@profvince.com>
Tue, 14 Apr 2015 16:32:59 +0000 (13:32 -0300)
committerVincent Pit <vince@profvince.com>
Tue, 14 Apr 2015 16:32:59 +0000 (13:32 -0300)
lib/VPIT/TestHelpers.pm

index bae97851cc47e8a8ac86eed95cc9e77f56db42d0..e8cfa710ea73aec55801f5f9fcdd03548cb8a3e8 100644 (file)
@@ -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 {