From 520996fff18a4d1545090f46549f9c15cec3bffa Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Tue, 14 Sep 2021 23:06:36 -0400 Subject: [PATCH] remove double import Imported both inside and outside of T.TYPE_CHECKING, the runtime import can be removed by quote-deferring one of the use sites. Update: In between then and now, this got removed from T.TYPE_CHECKING, move it back there rather than preserving the runtime import. --- mesonbuild/cmake/executor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mesonbuild/cmake/executor.py b/mesonbuild/cmake/executor.py index 65ff7308d..309b42955 100644 --- a/mesonbuild/cmake/executor.py +++ b/mesonbuild/cmake/executor.py @@ -23,11 +23,11 @@ import re import os from .. import mlog -from ..environment import Environment from ..mesonlib import PerMachine, Popen_safe, version_compare, MachineChoice, is_windows, OptionKey from ..programs import find_external_program, NonExistingExternalProgram if T.TYPE_CHECKING: + from ..environment import Environment from ..programs import ExternalProgram TYPE_result = T.Tuple[int, T.Optional[str], T.Optional[str]] @@ -65,7 +65,7 @@ class CMakeExecutor: if self.prefix_paths: self.extra_cmake_args += ['-DCMAKE_PREFIX_PATH={}'.format(';'.join(self.prefix_paths))] - def find_cmake_binary(self, environment: Environment, silent: bool = False) -> T.Tuple[T.Optional['ExternalProgram'], T.Optional[str]]: + def find_cmake_binary(self, environment: 'Environment', silent: bool = False) -> T.Tuple[T.Optional['ExternalProgram'], T.Optional[str]]: # Only search for CMake the first time and store the result in the class # definition if isinstance(CMakeExecutor.class_cmakebin[self.for_machine], NonExistingExternalProgram):