Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion refactor/ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,14 @@ def unparse(self, node: ast.AST) -> str:
... # pragma: no cover


class BaseUnparser(ast._Unparser): # type: ignore
try:
_UnparserBase = ast._Unparser
except AttributeError:
# Python 3.14+: _Unparser moved to C extension module
from _ast_unparse import Unparser as _UnparserBase # type: ignore[import-not-found]


class BaseUnparser(_UnparserBase): # type: ignore
"""A public :py:class:`ast._Unparser` API that can
be used to customize the AST re-synthesis process."""

Expand Down
Loading