Rev 6340: (gz) Propogate site.USER_BASE in selftest run_bzr_subprocess to keep the in file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/
Patch Queue Manager
pqm at pqm.ubuntu.com
Mon Dec 5 10:14:45 UTC 2011
At file:///srv/pqm.bazaar-vcs.org/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 6340 [merge]
revision-id: pqm at pqm.ubuntu.com-20111205101444-58xei8jjp03xy10w
parent: pqm at pqm.ubuntu.com-20111202130123-kak5duj7dxwwjla9
parent: martin.packman at canonical.com-20111201154356-s7v2ttjiil4fche8
committer: Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2011-12-05 10:14:44 +0000
message:
(gz) Propogate site.USER_BASE in selftest run_bzr_subprocess to keep the
same sys.path (Martin Packman)
modified:
bzrlib/tests/__init__.py selftest.py-20050531073622-8d0e3c8845c97a64
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py 2011-11-29 06:50:54 +0000
+++ b/bzrlib/tests/__init__.py 2011-12-01 15:43:56 +0000
@@ -36,6 +36,7 @@
import random
import re
import shlex
+import site
import stat
import subprocess
import sys
@@ -2184,6 +2185,11 @@
if env_changes is None:
env_changes = {}
+ # Because $HOME is set to a tempdir for the context of a test, modules
+ # installed in the user dir will not be found unless $PYTHONUSERBASE
+ # gets set to the computed directory of this parent process.
+ if site.USER_BASE is not None:
+ env_changes["PYTHONUSERBASE"] = site.USER_BASE
old_env = {}
def cleanup_environment():
More information about the bazaar-commits
mailing list