From 0a4575a1da49334c0daec782f0af118dbdc42373 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Thu, 26 Nov 2020 13:51:05 -0800 Subject: [PATCH] python/hooks/pythonNamespaces: fix __pycache__ being empty, or not existing --- .../interpreters/python/hooks/python-namespaces-hook.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh b/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh index ebc94e076c8..15d2bd0eb34 100644 --- a/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh +++ b/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh @@ -26,7 +26,9 @@ pythonNamespacesHook() { # remove __pycache__/ entry, can be interpreter specific. E.g. __init__.cpython-38.pyc # use null characters to perserve potential whitespace in filepath - @findutils@/bin/find $pycachePath -name '__init__*' -print0 | xargs -0 rm -v + if [ -d "$pycachePath" ]; then + @findutils@/bin/find "$pycachePath" -name '__init__*' -exec rm -v "{}" + + fi done done