From: Zac Medico Date: Mon, 23 Mar 2009 02:20:42 +0000 (-0000) Subject: Inside spawn(), avoid redundant os.access() and stat() calls on commonly X-Git-Tag: v2.1.6.10~8 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=62cbda66a40db1282cd9d8acae201b31c2ed1dfb;p=portage.git Inside spawn(), avoid redundant os.access() and stat() calls on commonly spawned binaries such as BASH_BINARY, SANDBOX_BINARY, and FAKEROOT_BINARY. Thanks to Piotr JaroszyƄski for reporting. (trunk r13144) svn path=/main/branches/2.1.6/; revision=13161 --- diff --git a/pym/portage/process.py b/pym/portage/process.py index 6f449c3d6..a88f5bf28 100644 --- a/pym/portage/process.py +++ b/pym/portage/process.py @@ -181,7 +181,8 @@ def spawn(mycommand, env={}, opt_name=None, fd_pipes=None, returnpid=False, # If an absolute path to an executable file isn't given # search for it unless we've been told not to. binary = mycommand[0] - if (not os.path.isabs(binary) or not os.path.isfile(binary) + if binary not in (BASH_BINARY, SANDBOX_BINARY, FAKEROOT_BINARY) and \ + (not os.path.isabs(binary) or not os.path.isfile(binary) or not os.access(binary, os.X_OK)): binary = path_lookup and find_binary(binary) or None if not binary: