summaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter/primitives/string.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-03-01 23:55:42 -0500
committerEli Schwartz <eschwartz@archlinux.org>2022-03-07 19:09:50 -0500
commitc231c4bd2ad1a9b0ddb00a838c89566bc88d2a8e (patch)
treee2e782b9d7883b96a1bcecc13ddc51d6656bdf20 /mesonbuild/interpreter/primitives/string.py
parenta009eacc65ddb447edcfc9fd317ad828d9b3353a (diff)
downloadmeson-c231c4bd2ad1a9b0ddb00a838c89566bc88d2a8e.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/interpreter/primitives/string.py')
-rw-r--r--mesonbuild/interpreter/primitives/string.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/mesonbuild/interpreter/primitives/string.py b/mesonbuild/interpreter/primitives/string.py
index 9cd51b4c4..912930306 100644
--- a/mesonbuild/interpreter/primitives/string.py
+++ b/mesonbuild/interpreter/primitives/string.py
@@ -1,5 +1,6 @@
# Copyright 2021 The Meson development team
# SPDX-license-identifier: Apache-2.0
+from __future__ import annotations
import re
import os
@@ -17,9 +18,6 @@ from ...interpreterbase import (
noPosargs,
typed_pos_args,
- TYPE_var,
- TYPE_kwargs,
-
InvalidArguments,
)
@@ -27,6 +25,7 @@ from ...interpreterbase import (
if T.TYPE_CHECKING:
# Object holders need the actual interpreter
from ...interpreter import Interpreter
+ from ...interpreterbase import TYPE_var, TYPE_kwargs
class StringHolder(ObjectHolder[str]):
def __init__(self, obj: str, interpreter: 'Interpreter') -> None: