summaryrefslogtreecommitdiffstats
path: root/Objects/codeobject.c
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2025-06-18 23:57:18 (GMT)
committerGitHub <noreply@github.com>2025-06-18 23:57:18 (GMT)
commitc03f94e7fe2fe96827ed96ce78aed0fc88fb8358 (patch)
tree19473be51a2330ccd64b0877bd5df028feb6596c /Objects/codeobject.c
parent47ee2aedf11fe6fb274dfc2bfc9ac51136f6113c (diff)
downloadcpython-c03f94e7fe2fe96827ed96ce78aed0fc88fb8358.zip
cpython-c03f94e7fe2fe96827ed96ce78aed0fc88fb8358.tar.gz
cpython-c03f94e7fe2fe96827ed96ce78aed0fc88fb8358.tar.bz2
[3.14] gh-135450: Remove assertion in `_PyCode_CheckNoExternalState` (gh-135694)
The assertion reflected a misunderstanding of situations where "hidden" variables might exist, namely generator expressions and comprehensions. (cherry picked from commit 15f2bac02c5e, AKA gh-135466) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Diffstat (limited to 'Objects/codeobject.c')
-rw-r--r--Objects/codeobject.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index 34b50ef..3f53d4c 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -1999,7 +1999,6 @@ _PyCode_CheckNoExternalState(PyCodeObject *co, _PyCode_var_counts_t *counts,
const char **p_errmsg)
{
const char *errmsg = NULL;
- assert(counts->locals.hidden.total == 0);
if (counts->numfree > 0) { // It's a closure.
errmsg = "closures not supported";
}