From 46148f923b196e1b1d004e68d43edc2daca4dd25 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Tue, 14 Jun 2022 07:11:02 -0400 Subject: [PATCH] fix totally invalid import of an import MachineChoice is a mesonlib object, not a compilers object, so it makes no sense to import it from the latter simply because the latter imports it too. This results in brittle module dependencies and everything breaking when a refactor removes it from the latter. ... also it is a typing-only import so while we are fixing it to import from the right place, we can also put it in a type-checking block. --- mesonbuild/compilers/cs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mesonbuild/compilers/cs.py b/mesonbuild/compilers/cs.py index b38f626a8..9690cdb55 100644 --- a/mesonbuild/compilers/cs.py +++ b/mesonbuild/compilers/cs.py @@ -11,6 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +from __future__ import annotations import os.path, subprocess import textwrap @@ -19,12 +20,13 @@ import typing as T from ..mesonlib import EnvironmentException from ..linkers import RSPFileSyntax -from .compilers import Compiler, MachineChoice, mono_buildtype_args +from .compilers import Compiler, mono_buildtype_args from .mixins.islinker import BasicLinkerIsCompilerMixin if T.TYPE_CHECKING: from ..envconfig import MachineInfo from ..environment import Environment + from ..mesonlib import MachineChoice cs_optimization_args = {'0': [], 'g': [],