Index: tests/Makefile.am
===================================================================
--- tests/Makefile.am	(revision 2a59655a1dd1d977b68a881bb4951a8e017eeb1d)
+++ tests/Makefile.am	(revision 58fe85a783c7d674af3da0f1fd03f42ef7f11be5)
@@ -103,9 +103,9 @@
 
 mostlyclean-local :
+	find ${builddir} -not -path './__pycache__/*' -path '*.o' -delete
+	find ${builddir} -not -path './__pycache__/*' -path '*/.err/*.log' -delete
+	find ${builddir} -not -path './__pycache__/*' -path '*/.out/*.log' -delete
 	rm -f ${EXTRA_PROGRAMS}
 	rm -rf __pycache__
-	find ${builddir} -path '*.o' -delete
-	find ${builddir} -path '*/.err/*.log' -delete
-	find ${builddir} -path '*/.out/*.log' -delete
 
 distclean-local :
