-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Interpreter fails when deals with nested loops or functions. Noticed in issue. Also, it fails to run the following code(just a simple example):
def f(x):
for i in range(x):
print(i)
and returns this output:
pydantic version: v2.6.1, pydantic-core version: v2.16.2
Traceback (most recent call last):
File "/lib/python311.zip/_pyodide/_base.py", line 144, in _parse_and_compile_gen
mod = compile(source, filename, mode, flags | ast.PyCF_ONLY_AST)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 3
print(i)
IndentationError: expected an indented block after 'for' statement on line 2
This applies to all codeblocks with nested functions | classes | loops I tested.
Note: It is also triggered by nested if else statements.
Metadata
Metadata
Assignees
Labels
No labels