Prevent errors on non-existent key fetching e.g LD_PRELOAD & LD_LIBRARY_PATH.
Uses .get() with a default empty string to prevent this case.
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
start_session(session_info)
test_env = os.environ.copy()
-test_env["LD_PRELOAD"] += ":liblttng-ust-dl.so"
-test_env["LD_LIBRARY_PATH"] += ":" + test_path
+test_env["LD_PRELOAD"] = test_env.get("LD_PRELOAD", "") + ":liblttng-ust-dl.so"
+test_env["LD_LIBRARY_PATH"] = test_env.get("LD_LIBRARY_PATH", "") + ":" + test_path
test_process = subprocess.Popen(test_path + "prog",
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
env=test_env)