mirror of
https://github.com/python/cpython.git
synced 2025-11-07 00:51:49 +00:00
[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 15f2bac02c, AKA gh-135466)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
This commit is contained in:
parent
47ee2aedf1
commit
c03f94e7fe
2 changed files with 16 additions and 1 deletions
|
|
@ -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";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue