]> granicus.if.org Git - python/commit
bpo-32176: Set CO_NOFREE in the code object constructor (GH-4675)
authorNick Coghlan <ncoghlan@gmail.com>
Sun, 3 Dec 2017 01:12:20 +0000 (11:12 +1000)
committerGitHub <noreply@github.com>
Sun, 3 Dec 2017 01:12:20 +0000 (11:12 +1000)
commit078f1814f1a4413a2a0fdb8cf4490ee0fc98ef34
tree204192eaa105d79d354dbede16b5474dc9cdc4ee
parent7324b5ce8e7c031a0a3832a6a8d7c639111ae0ff
bpo-32176: Set CO_NOFREE in the code object constructor (GH-4675)

Previously, CO_NOFREE was set in the compiler, which meant
it could end up being set incorrectly when code objects
were created directly. Setting it in the constructor based
on freevars and cellvars ensures it is always accurate,
regardless of how the code object is defined.
Lib/test/test_code.py
Misc/NEWS.d/next/Core and Builtins/2017-12-02-21-37-22.bpo-32176.Wt25-N.rst [new file with mode: 0644]
Objects/codeobject.c
Python/compile.c