summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/__init__.py2
-rw-r--r--pym/portage/package/ebuild/doebuild.py3
-rw-r--r--pym/portage/process.py3
-rw-r--r--pym/portage/tests/ebuild/test_ipc_daemon.py3
4 files changed, 5 insertions, 6 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index fb4c66cb1..a6760b245 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -325,8 +325,6 @@ 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/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index e85785528..7400da7c0 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -108,6 +108,9 @@ def doebuild_environment(myebuild, mydo, myroot, mysettings,
mysettings["PORTAGE_MASTER_PID"] = str(os.getpid())
+ # Set requested Python interpreter for Portage helpers.
+ mysettings['PORTAGE_PYTHON'] = sys.executable
+
# We are disabling user-specific bashrc files.
mysettings["BASH_ENV"] = INVALID_ENV_FILE
diff --git a/pym/portage/process.py b/pym/portage/process.py
index 331e88059..aed727167 100644
--- a/pym/portage/process.py
+++ b/pym/portage/process.py
@@ -375,9 +375,6 @@ 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 b03409d0f..f0d072aed 100644
--- a/pym/portage/tests/ebuild/test_ipc_daemon.py
+++ b/pym/portage/tests/ebuild/test_ipc_daemon.py
@@ -1,6 +1,7 @@
# Copyright 2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+import sys
import shutil
import tempfile
from portage import os
@@ -19,7 +20,7 @@ class IpcDaemonTestCase(TestCase):
tmpdir = tempfile.mkdtemp()
try:
env = {}
- env['PORTAGE_PYTHON'] = os.environ['PORTAGE_PYTHON']
+ env['PORTAGE_PYTHON'] = sys.executable
env['PORTAGE_BIN_PATH'] = PORTAGE_BIN_PATH
env['PORTAGE_PYM_PATH'] = PORTAGE_PYM_PATH
env['PORTAGE_BUILDDIR'] = tmpdir