summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/gcmodule.c6
1 files changed, 5 insertions, 1 deletions
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 @@ _PyGC_Insert(PyObject *op)
abort();
}
#endif
- if (allocated > threshold0 && enabled && threshold0 && !collecting) {
+ if (allocated > threshold0 &&
+ enabled &&
+ threshold0 &&
+ !collecting &&
+ !PyErr_Occurred()) {
collecting++;
collect_generations();
collecting--;