process._exec: tweak opt_name for PyPy
authorZac Medico <zmedico@gentoo.org>
Fri, 2 Dec 2011 03:24:10 +0000 (19:24 -0800)
committerZac Medico <zmedico@gentoo.org>
Fri, 2 Dec 2011 03:24:10 +0000 (19:24 -0800)
PyPy 1.7 will die due to "libary path not found" if argv[0] does not
contain the full path of the binary.

pym/portage/process.py

index 3c1537074f7440153632ecc8cc46c66a94a9cc69..1ee5b9ae6cd951d82dc49d3c6f02363798e54a34 100644 (file)
@@ -343,7 +343,12 @@ def _exec(binary, mycommand, opt_name, fd_pipes, env, gid, groups, uid, umask,
        # If the process we're creating hasn't been given a name
        # assign it the name of the executable.
        if not opt_name:
-               opt_name = os.path.basename(binary)
+               if binary is portage._python_interpreter:
+                       # NOTE: PyPy 1.7 will die due to "libary path not found" if argv[0]
+                       # does not contain the full path of the binary.
+                       opt_name = binary
+               else:
+                       opt_name = os.path.basename(binary)
 
        # Set up the command's argument list.
        myargs = [opt_name]