diff --git a/Src/IronPython/Compiler/Ast/Comprehension.cs b/Src/IronPython/Compiler/Ast/Comprehension.cs index 81948fd44..42fbc20bd 100644 --- a/Src/IronPython/Compiler/Ast/Comprehension.cs +++ b/Src/IronPython/Compiler/Ast/Comprehension.cs @@ -246,7 +246,7 @@ internal override bool ExposesLocalVariable(PythonVariable variable) { } internal override MSAst.Expression/*!*/ GetParentClosureTuple() { - Debug.Assert(NeedsLocalContext); + Debug.Assert(NeedsLocalContext || IsClosure); return MSAst.Expression.Call(null, typeof(PythonOps).GetMethod(nameof(PythonOps.GetClosureTupleFromContext)), Parent.LocalContext); }