Catch OSError when restoring library environment (Closes #1130)

This commit is contained in:
Mathieu Comandon 2020-04-10 19:06:02 -07:00
parent fec9fbf750
commit 8a0438e22f

View file

@ -326,7 +326,10 @@ def reset_library_preloads():
"""Remove library preloads from environment"""
for key in ("LD_LIBRARY_PATH", "LD_PRELOAD"):
if os.environ.get(key):
del os.environ[key]
try:
del os.environ[key]
except OSError:
logger.error("Failed to delete environment variable %s", key)
def run_once(function):