summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiro HronĨok <miro@hroncok.cz>2018-05-11 07:40:43 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2018-05-11 08:40:43 +0300
commit7ec8f28656ea9d84048e9b5655375c6a74a59f53 (patch)
tree3278046b4177919761ea7c9ee16816e174613970
parentb551e9f0ff25018a5606465003e2c51c04f693a3 (diff)
downloadcpython-git-7ec8f28656ea9d84048e9b5655375c6a74a59f53.tar.gz
bpo-33455: Pass os.environ in test_posix::test_specify_environment. (GH-6753)
Pass os.environ's copy to new process created at test_posix: test_specify_environment. Otherwise important variables such as LD_LIBRARY_PATH are not set and the child process might not work at all in an environment where such variables are required for Python to function.
-rw-r--r--Lib/test/test_posix.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index b94da3f45a..ecf3e93eb0 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -1462,7 +1462,7 @@ class TestPosixSpawn(unittest.TestCase):
"""
pid = posix.posix_spawn(sys.executable,
[sys.executable, '-c', script],
- {'foo': 'bar'})
+ {**os.environ, 'foo': 'bar'})
self.assertEqual(os.waitpid(pid, 0), (pid, 0))
with open(envfile) as f:
self.assertEqual(f.read(), 'bar')