diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-04-05 14:08:31 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-04-11 07:46:53 +0000 |
commit | 6a4cabb866f66d4128a97cdc6d9d08ce074f1247 (patch) | |
tree | ab00f70a5e89278d6a0d16ff0c42578dc4d84a2d /chromium/net/test/python_utils.cc | |
parent | e733310db58160074f574c429d48f8308c0afe17 (diff) | |
download | qtwebengine-chromium-6a4cabb866f66d4128a97cdc6d9d08ce074f1247.tar.gz |
BASELINE: Update Chromium to 57.0.2987.144
Change-Id: I29db402ff696c71a04c4dbaec822c2e53efe0267
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'chromium/net/test/python_utils.cc')
-rw-r--r-- | chromium/net/test/python_utils.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/chromium/net/test/python_utils.cc b/chromium/net/test/python_utils.cc index 868abbb4e35..57429626b17 100644 --- a/chromium/net/test/python_utils.cc +++ b/chromium/net/test/python_utils.cc @@ -23,6 +23,7 @@ #endif const char kPythonPathEnv[] = "PYTHONPATH"; +const char kPythonVirtualEnv[] = "VIRTUAL_ENV"; void ClearPythonPath() { std::unique_ptr<base::Environment> env(base::Environment::Create()); @@ -102,6 +103,10 @@ struct PythonExePath { static base::LazyInstance<PythonExePath>::Leaky g_python_path; #endif +bool IsInPythonVirtualEnv() { + return base::Environment::Create()->HasVar(kPythonVirtualEnv); +} + bool GetPythonCommand(base::CommandLine* python_cmd) { DCHECK(python_cmd); @@ -121,8 +126,10 @@ bool GetPythonCommand(base::CommandLine* python_cmd) { // gtest output in buildbot log files. See http://crbug.com/147368. python_cmd->AppendArg("-u"); - // Prevent using system-installed libraries. Use hermetic versioned copies. - python_cmd->AppendArg("-S"); + if (!IsInPythonVirtualEnv()) { + // Prevent using system-installed libraries. Use hermetic versioned copies. + python_cmd->AppendArg("-S"); + } return true; } |