]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-142349: Fix ast.unparse for lazy import statements (#144893)
authorPablo Galindo Salgado <Pablogsal@gmail.com>
Mon, 16 Feb 2026 22:57:49 +0000 (22:57 +0000)
committerGitHub <noreply@github.com>
Mon, 16 Feb 2026 22:57:49 +0000 (22:57 +0000)
commit18c04f2e2a7e47329e9eefc5f269afe2d68729b0
tree2241edd1a7c42f55c2a5e90101e188fa4c94aa61
parent185a6e942af3e44b3bdb2bdcf2d55c0a6208f89b
gh-142349: Fix ast.unparse for lazy import statements (#144893)

The unparser was not handling the `is_lazy` attribute on Import and
ImportFrom AST nodes, causing lazy imports to be unparsed as regular
imports. This broke the round-trip (parse → unparse → reparse) for
any file containing `lazy import` statements.
Lib/_ast_unparse.py