- do not start collection during processing of an exception
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c
index cf88481..ba95032 100644
--- a/Modules/gcmodule.c
+++ b/Modules/gcmodule.c
@@ -502,7 +502,11 @@
 		abort();
 	}
 #endif
-	if (allocated > threshold0 && enabled && threshold0 && !collecting) {
+	if (allocated > threshold0 &&
+	    enabled &&
+	    threshold0 &&
+	    !collecting &&
+	    !PyErr_Occurred()) {
 		collecting++;
 		collect_generations();
 		collecting--;