[svn:parrot] r42920 - trunk/runtime/parrot/library

fperrad at svn.parrot.org fperrad at svn.parrot.org
Sun Dec 6 18:31:54 UTC 2009


Author: fperrad
Date: Sun Dec  6 18:31:54 2009
New Revision: 42920
URL: https://trac.parrot.org/parrot/changeset/42920

Log:
[distutils] throws an exception when a command system fails

Modified:
   trunk/runtime/parrot/library/distutils.pir

Modified: trunk/runtime/parrot/library/distutils.pir
==============================================================================
--- trunk/runtime/parrot/library/distutils.pir	Sun Dec  6 17:22:25 2009	(r42919)
+++ trunk/runtime/parrot/library/distutils.pir	Sun Dec  6 18:31:54 2009	(r42920)
@@ -324,6 +324,7 @@
     goto L1
   L2:
 
+    push_eh _handler
     $P0 = iter steps
     if $P0 goto L11
     # default step
@@ -338,6 +339,12 @@
     say $S0
     run_step('usage')
   L12:
+    pop_eh
+    end
+  _handler:
+    .local pmc ex
+    .get_results (ex)
+    rethrow ex
 .end
 
 =item run_step
@@ -3333,6 +3340,15 @@
     say cmd
   L1:
     $I0 = spawnw cmd
+    unless $I0 goto L2
+    $S0 = "exit status: "
+    $S1 = $I0
+    $S0 .= $S1
+    $S0 .= "\ncommand: "
+    $S0 .= cmd
+    $S0 .= "\n"
+    die $S0
+  L2:
 .end
 
 .include 'stat.pasm'


More information about the parrot-commits mailing list