[3.7] bpo-33622: Fix issues with handling errors in the GC. (GH-7078) by miss-islington · Pull Request #7094 · python/cpython

@serhiy-storchaka @miss-islington

* Fixed a leak when the GC fails to add an object with __del__ into
  the gc.garbage list.
* PyGC_Collect() can now be called when an exception is set and
  preserves it.
* Fixed an undefined behavior with comparing a dead pointer with NULL.
(cherry picked from commit 301e3cc)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>

@bedevere-bot mentioned this pull request

May 24, 2018

serhiy-storchaka