Raise a CommandNotFound exception when necessary, to ease troubleshooting. Thanks...
authorZac Medico <zmedico@gentoo.org>
Wed, 21 Feb 2007 04:37:32 +0000 (04:37 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 21 Feb 2007 04:37:32 +0000 (04:37 -0000)
svn path=/main/branches/2.1.2/; revision=6022

pym/portage_exec.py

index 252fed2a0f5fa476d561785107c0fc16eaf462ab..800535f55fb9a2b365cea4f1117746c381c33db6 100644 (file)
@@ -9,7 +9,7 @@ import portage_data
 
 from portage_util import dump_traceback
 from portage_const import BASH_BINARY, SANDBOX_BINARY
-
+from portage_exception import CommandNotFound
 
 try:
        import resource
@@ -157,7 +157,7 @@ def spawn(mycommand, env={}, opt_name=None, fd_pipes=None, returnpid=False,
            or not os.access(binary, os.X_OK)):
                binary = path_lookup and find_binary(binary) or None
                if not binary:
-                       return -1
+                       raise CommandNotFound(mycommand[0])
 
        # If we haven't been told what file descriptors to use
        # default to propogating our stdin, stdout and stderr.