From cd97c055a09c076de0cecf28f683d43d4da35d20 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Wed, 19 Feb 2020 18:36:56 -0800 Subject: [PATCH] python: execute pythonImportsCheckPhase in subshell Execute in subshell so that the cwd returns back to the original directory. This is important as it enables pythonImportsCheck to work with checkPhase --- .../interpreters/python/hooks/python-imports-check-hook.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/python/hooks/python-imports-check-hook.sh b/pkgs/development/interpreters/python/hooks/python-imports-check-hook.sh index 0fc55145a8e..f8ca84cd573 100644 --- a/pkgs/development/interpreters/python/hooks/python-imports-check-hook.sh +++ b/pkgs/development/interpreters/python/hooks/python-imports-check-hook.sh @@ -6,7 +6,7 @@ pythonImportsCheckPhase () { if [ -n "$pythonImportsCheck" ]; then echo "Check whether the following modules can be imported: $pythonImportsCheck" - cd $out && eval "@pythonCheckInterpreter@ -c 'import os; import importlib; list(map(lambda mod: importlib.import_module(mod), os.environ[\"pythonImportsCheck\"].split()))'" + ( cd $out && eval "@pythonCheckInterpreter@ -c 'import os; import importlib; list(map(lambda mod: importlib.import_module(mod), os.environ[\"pythonImportsCheck\"].split()))'" ) fi }