gh-135450: Remove assertion in _PyCode_CheckNoExternalState (gh-135466)
The assertion reflected a misunderstanding of situations where "hidden" variables might exist, namely generator expressions and comprehensions.
This commit is contained in:
@@ -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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user