Skip to content

Commit

Permalink
use new astcompat module
Browse files Browse the repository at this point in the history
  • Loading branch information
Technologicat committed Sep 27, 2024
1 parent e9838a4 commit 6de63b8
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions mcpyrate/astfixers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,10 @@
Delete, For, Load, Store, Subscript, comprehension,
iter_child_nodes, withitem)
from copy import copy
from typing import Type

from .astcompat import NamedExpr, TypeAlias
from . import walkers

class _NoSuchNodeType:
pass

try: # Python 3.8+
from ast import NamedExpr
except ImportError:
NamedExpr: Type = _NoSuchNodeType # type: ignore[no-redef]

try: # Python 3.12+
from ast import TypeAlias
except ImportError:
TypeAlias: Type = _NoSuchNodeType # type: ignore[no-redef]


class _CtxFixer(walkers.ASTTransformer):
def __init__(self, *, copy_seen_nodes):
super().__init__(ctxclass=Load)
Expand Down

0 comments on commit 6de63b8

Please sign in to comment.