summaryrefslogtreecommitdiff
path: root/mesonbuild/scripts/run_tool.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-03-22 20:28:59 -0400
committerEli Schwartz <eschwartz@archlinux.org>2022-03-29 16:44:54 -0400
commitc9938f8f60c0b7cca7a5668807b17badb7861c86 (patch)
tree6bbdb301a2c8ce4b92866a04703ada96241683b4 /mesonbuild/scripts/run_tool.py
parent05cfe756f1c2dbd212aa6d30a3879cfe47a7f2fd (diff)
downloadmeson-c9938f8f60c0b7cca7a5668807b17badb7861c86.tar.gz
move a bunch of imports into TYPE_CHECKING blocks
These are only used for type checking, so don't bother importing them at runtime. Generally add future annotations at the same time, to make sure that existing uses of these imports don't need to be quoted.
Diffstat (limited to 'mesonbuild/scripts/run_tool.py')
-rw-r--r--mesonbuild/scripts/run_tool.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/scripts/run_tool.py b/mesonbuild/scripts/run_tool.py
index 700f45942..f120df275 100644
--- a/mesonbuild/scripts/run_tool.py
+++ b/mesonbuild/scripts/run_tool.py
@@ -11,8 +11,8 @@
# 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 subprocess
import itertools
import fnmatch
from pathlib import Path
@@ -22,6 +22,9 @@ from ..compilers import lang_suffixes
from ..mesonlib import Popen_safe
import typing as T
+if T.TYPE_CHECKING:
+ import subprocess
+
def parse_pattern_file(fname: Path) -> T.List[str]:
patterns = []
try: