summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-13 19:01:14 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-13 19:01:14 -0700
commit5546223c61ff1723f047143502a2cae332622e2e (patch)
tree0c32e1710291368ffdc5c8ee19855d4466db16c8 /pym
parent3146e53630438473ad241939a5dfa2b71e9cf559 (diff)
parent2d8eaedb61bdbe4a47d6b27c8a3e67754078773d (diff)
downloadportage-5546223c61ff1723f047143502a2cae332622e2e.tar.gz
portage-5546223c61ff1723f047143502a2cae332622e2e.tar.bz2
portage-5546223c61ff1723f047143502a2cae332622e2e.zip
Merge branch 'master' of git+ssh://git.overlays.gentoo.org/proj/portage
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/__init__.py2
-rw-r--r--pym/portage/process.py5
-rw-r--r--pym/portage/tests/ebuild/test_ipc_daemon.py1
3 files changed, 7 insertions, 1 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index a6760b245..fb4c66cb1 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -325,6 +325,8 @@ except (ImportError, OSError) as e:
# END OF IMPORTS -- END OF IMPORTS -- END OF IMPORTS -- END OF IMPORTS -- END
# ===========================================================================
+os.environ['PORTAGE_PYTHON'] = sys.executable
+
def _ensure_default_encoding():
default_encoding = sys.getdefaultencoding().lower().replace('-', '_')
diff --git a/pym/portage/process.py b/pym/portage/process.py
index 9f6ec0e56..331e88059 100644
--- a/pym/portage/process.py
+++ b/pym/portage/process.py
@@ -355,7 +355,7 @@ def _exec(binary, mycommand, opt_name, fd_pipes, env, gid, groups, uid, umask,
# Then assign them to what they should be.
for fd in my_fds:
os.dup2(my_fds[fd], fd)
- # Then close _all_ fds that haven't been explictly
+ # Then close _all_ fds that haven't been explicitly
# requested to be kept open.
for fd in get_open_fds():
if fd not in my_fds:
@@ -375,6 +375,9 @@ def _exec(binary, mycommand, opt_name, fd_pipes, env, gid, groups, uid, umask,
os.umask(umask)
if pre_exec:
pre_exec()
+
+ # Set requested Python interpreter for Portage helpers.
+ env['PORTAGE_PYTHON'] = sys.executable
# And switch to the new process.
os.execve(binary, myargs, env)
diff --git a/pym/portage/tests/ebuild/test_ipc_daemon.py b/pym/portage/tests/ebuild/test_ipc_daemon.py
index de548c6f1..b03409d0f 100644
--- a/pym/portage/tests/ebuild/test_ipc_daemon.py
+++ b/pym/portage/tests/ebuild/test_ipc_daemon.py
@@ -19,6 +19,7 @@ class IpcDaemonTestCase(TestCase):
tmpdir = tempfile.mkdtemp()
try:
env = {}
+ env['PORTAGE_PYTHON'] = os.environ['PORTAGE_PYTHON']
env['PORTAGE_BIN_PATH'] = PORTAGE_BIN_PATH
env['PORTAGE_PYM_PATH'] = PORTAGE_PYM_PATH
env['PORTAGE_BUILDDIR'] = tmpdir