Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 97d723b

Browse files
committed
- do not start collection during processing of an exception
1 parent 5196c58 commit 97d723b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Modules/gcmodule.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,11 @@ _PyGC_Insert(PyObject *op)
502502
abort();
503503
}
504504
#endif
505-
if (allocated > threshold0 && enabled && threshold0 && !collecting) {
505+
if (allocated > threshold0 &&
506+
enabled &&
507+
threshold0 &&
508+
!collecting &&
509+
!PyErr_Occurred()) {
506510
collecting++;
507511
collect_generations();
508512
collecting--;

0 commit comments

Comments
 (0)