@@ -63,9 +63,16 @@ def _spawn_nt ( cmd,
6363 print string .join ( [executable ] + cmd [1 :], ' ' )
6464 if not dry_run :
6565 # spawn for NT requires a full path to the .exe
66- rc = os .spawnv (os .P_WAIT , executable , cmd )
66+ try :
67+ rc = os .spawnv (os .P_WAIT , executable , cmd )
68+ except OSError , exc :
69+ # this seems to happen when the command isn't found
70+ raise DistutilsExecError , \
71+ "command '%s' failed: %s" % (cmd [0 ], exc [- 1 ])
6772 if rc != 0 :
68- raise DistutilsExecError ("command failed: %d" % rc )
73+ # and this reflects the command running but failing
74+ raise DistutilsExecError , \
75+ "command '%s' failed with exit status %d" % (cmd [0 ], rc )
6976
7077
7178
@@ -103,7 +110,7 @@ def _spawn_posix (cmd,
103110 (pid , status ) = os .waitpid (pid , 0 )
104111 if os .WIFSIGNALED (status ):
105112 raise DistutilsExecError , \
106- "command %s terminated by signal %d" % \
113+ "command '%s' terminated by signal %d" % \
107114 (cmd [0 ], os .WTERMSIG (status ))
108115
109116 elif os .WIFEXITED (status ):
@@ -112,14 +119,14 @@ def _spawn_posix (cmd,
112119 return # hey, it succeeded!
113120 else :
114121 raise DistutilsExecError , \
115- "command %s failed with exit status %d" % \
122+ "command '%s' failed with exit status %d" % \
116123 (cmd [0 ], exit_status )
117124
118125 elif os .WIFSTOPPED (status ):
119126 continue
120127
121128 else :
122129 raise DistutilsExecError , \
123- "unknown error executing %s : termination status %d" % \
130+ "unknown error executing '%s' : termination status %d" % \
124131 (cmd [0 ], status )
125132# _spawn_posix ()
0 commit comments