]> granicus.if.org Git - python/commit
bpo-24596: Decref module in PyRun_SimpleFileExFlags() on SystemExit (GH-7918) (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 3 Jul 2018 20:17:46 +0000 (13:17 -0700)
committerAntoine Pitrou <pitrou@free.fr>
Tue, 3 Jul 2018 20:17:46 +0000 (22:17 +0200)
commite1ebf51f76037b7e02711aaeb9bf66c9147f4c74
tree0b3a3e62b437582437089205a9073c2c5ac2bcf2
parentf55a818954212e8e6c97e3d66cf1478120a3220f
bpo-24596: Decref module in PyRun_SimpleFileExFlags() on SystemExit (GH-7918) (GH-8069)

PyErr_Print() will not return when the exception is a SystemExit, so
decref the __main__ module object in that case.
(cherry picked from commit d8cba5d16f1333fd625726fc72e66afbd45b8d00)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Lib/test/test_gc.py
Misc/NEWS.d/next/Core and Builtins/2018-06-25-16-54-05.bpo-24596.Rkwova.rst [new file with mode: 0644]
Python/pythonrun.c