aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreterbase/disabler.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/interpreterbase/disabler.py
parenta009eacc65ddb447edcfc9fd317ad828d9b3353a (diff)
downloadmeson-c231c4bd2ad1a9b0ddb00a838c89566bc88d2a8e.zip
meson-c231c4bd2ad1a9b0ddb00a838c89566bc88d2a8e.tar.gz
meson-c231c4bd2ad1a9b0ddb00a838c89566bc88d2a8e.tar.bz2
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/interpreterbase/disabler.py')
-rw-r--r--mesonbuild/interpreterbase/disabler.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/mesonbuild/interpreterbase/disabler.py b/mesonbuild/interpreterbase/disabler.py
index 63b914e..182bb62 100644
--- a/mesonbuild/interpreterbase/disabler.py
+++ b/mesonbuild/interpreterbase/disabler.py
@@ -11,10 +11,15 @@
# 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
-from .baseobjects import MesonInterpreterObject, TYPE_var, TYPE_kwargs
import typing as T
+from .baseobjects import MesonInterpreterObject
+
+if T.TYPE_CHECKING:
+ from .baseobjects import TYPE_var, TYPE_kwargs
+
class Disabler(MesonInterpreterObject):
def method_call(self, method_name: str, args: T.List[TYPE_var], kwargs: TYPE_kwargs) -> TYPE_var:
if method_name == 'found':