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

pym/portage/process.py

index 20b1d705c41b9c5fd698568d9b8b25f3d3d35db2..dfc106e6bdd4705afdc6afe2689d064458ef1087 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.