summaryrefslogtreecommitdiffstats
path: root/Tools/build
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2023-01-04 15:41:39 (GMT)
committerGitHub <noreply@github.com>2023-01-04 15:41:39 (GMT)
commit15aecf8dd70f82eb507d74fae9662072a377bdc8 (patch)
tree6afd6d35744428bafd5b64bc6fccbb830534c86e /Tools/build
parentc31e356a10aa60b5967b9aaf80b9984059e46461 (diff)
downloadcpython-15aecf8dd70f82eb507d74fae9662072a377bdc8.zip
cpython-15aecf8dd70f82eb507d74fae9662072a377bdc8.tar.gz
cpython-15aecf8dd70f82eb507d74fae9662072a377bdc8.tar.bz2
GH-100719: Remove the `co_nplaincellvars` field from code objects. (GH-100721)
Diffstat (limited to 'Tools/build')
-rw-r--r--Tools/build/deepfreeze.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/Tools/build/deepfreeze.py b/Tools/build/deepfreeze.py
index e4b4228..511b26a 100644
--- a/Tools/build/deepfreeze.py
+++ b/Tools/build/deepfreeze.py
@@ -61,7 +61,6 @@ def get_localsplus_counts(code: types.CodeType,
names: Tuple[str, ...],
kinds: bytes) -> Tuple[int, int, int, int]:
nlocals = 0
- nplaincellvars = 0
ncellvars = 0
nfreevars = 0
assert len(names) == len(kinds)
@@ -72,15 +71,13 @@ def get_localsplus_counts(code: types.CodeType,
ncellvars += 1
elif kind & CO_FAST_CELL:
ncellvars += 1
- nplaincellvars += 1
elif kind & CO_FAST_FREE:
nfreevars += 1
assert nlocals == len(code.co_varnames) == code.co_nlocals, \
(nlocals, len(code.co_varnames), code.co_nlocals)
assert ncellvars == len(code.co_cellvars)
assert nfreevars == len(code.co_freevars)
- assert len(names) == nlocals + nplaincellvars + nfreevars
- return nlocals, nplaincellvars, ncellvars, nfreevars
+ return nlocals, ncellvars, nfreevars
PyUnicode_1BYTE_KIND = 1
@@ -243,7 +240,7 @@ class Printer:
co_localsplusnames = self.generate(name + "_localsplusnames", localsplusnames)
co_localspluskinds = self.generate(name + "_localspluskinds", localspluskinds)
# Derived values
- nlocals, nplaincellvars, ncellvars, nfreevars = \
+ nlocals, ncellvars, nfreevars = \
get_localsplus_counts(code, localsplusnames, localspluskinds)
co_code_adaptive = make_string_literal(code.co_code)
self.write("static")
@@ -268,7 +265,6 @@ class Printer:
self.field(code, "co_firstlineno")
self.write(f".co_nlocalsplus = {len(localsplusnames)},")
self.field(code, "co_nlocals")
- self.write(f".co_nplaincellvars = {nplaincellvars},")
self.write(f".co_ncellvars = {ncellvars},")
self.write(f".co_nfreevars = {nfreevars},")
self.write(f".co_version = {next_code_version},")