From 61d525cc16a10dcd780d2fc14a7371dc809223d0 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Tue, 28 Feb 2023 15:28:21 -0500 Subject: refactor a few subsystem-relative imports that imported the wrong location Inside of mesonbuild.ast.* we can and should import from .foobar, rather than importing from .__init__'s re-exported version of that object. Failing to do so results in an extremely brittle codebase where simply changing the order of lines in __init__.py can result in ImportError. --- mesonbuild/ast/postprocess.py | 2 +- mesonbuild/ast/printer.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mesonbuild/ast/postprocess.py b/mesonbuild/ast/postprocess.py index 0c28af09f..09c339dd6 100644 --- a/mesonbuild/ast/postprocess.py +++ b/mesonbuild/ast/postprocess.py @@ -16,7 +16,7 @@ # or an interpreter-based tool from __future__ import annotations -from . import AstVisitor +from .visitor import AstVisitor import typing as T if T.TYPE_CHECKING: diff --git a/mesonbuild/ast/printer.py b/mesonbuild/ast/printer.py index 3c5391018..579a83d00 100644 --- a/mesonbuild/ast/printer.py +++ b/mesonbuild/ast/printer.py @@ -17,7 +17,7 @@ from __future__ import annotations from .. import mparser -from . import AstVisitor +from .visitor import AstVisitor import re import typing as T -- cgit v1.2.3