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.
pull/9348/head
Eli Schwartz 3 years ago
parent 1bb2523e58
commit 520996fff1
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 4
      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):

Loading…
Cancel
Save