diff --git a/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh b/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh index 12ae50a19812..37479d9d4111 100644 --- a/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh +++ b/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh @@ -25,7 +25,12 @@ pythonNamespacesHook() { fi # remove ${pname}-${version}-${python-interpeter}-nspkg.pth - if [ -z ${dontRemovePth-} ]; then + # + # Still need to check that parent directory exists in the + # event of a "meta-package" package, which will just install + # other packages, but not produce anything in site-packages + # besides meta information + if [ -d "${constructedPath}/../" -a -z ${dontRemovePth-} ]; then # .pth files are located in the parent directory of a module @findutils@/bin/find ${constructedPath}/../ -name '*-nspkg.pth' -exec rm -v "{}" + fi