]> git.vpit.fr Git - perl/modules/VPIT-TestHelpers.git/blobdiff - lib/VPIT/TestHelpers.pm
Work around old IPC::Open3 reporting exceptions on STDERR
[perl/modules/VPIT-TestHelpers.git] / 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 {