summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2017-12-03 01:12:20 (GMT)
committerGitHub <noreply@github.com>2017-12-03 01:12:20 (GMT)
commit078f1814f1a4413a2a0fdb8cf4490ee0fc98ef34 (patch)
tree204192eaa105d79d354dbede16b5474dc9cdc4ee /Misc
parent7324b5ce8e7c031a0a3832a6a8d7c639111ae0ff (diff)
downloadcpython-078f1814f1a4413a2a0fdb8cf4490ee0fc98ef34.zip
cpython-078f1814f1a4413a2a0fdb8cf4490ee0fc98ef34.tar.gz
cpython-078f1814f1a4413a2a0fdb8cf4490ee0fc98ef34.tar.bz2
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.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2017-12-02-21-37-22.bpo-32176.Wt25-N.rst5
1 files changed, 5 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2017-12-02-21-37-22.bpo-32176.Wt25-N.rst b/Misc/NEWS.d/next/Core and Builtins/2017-12-02-21-37-22.bpo-32176.Wt25-N.rst
new file mode 100644
index 0000000..9d56711
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2017-12-02-21-37-22.bpo-32176.Wt25-N.rst
@@ -0,0 +1,5 @@
+co_flags.CO_NOFREE is now always set correctly by the code object
+constructor based on freevars and cellvars, rather than needing to be set
+correctly by the caller. This ensures it will be cleared automatically when
+additional cell references are injected into a modified code object and
+function.