From ee0e67a63b62d64c63c4ec7bfc034b940c8a4c0e Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Tue, 1 Sep 2026 15:54:48 +0500 Subject: [PATCH] build-all: use `find_spec` to check `aqt` --- nix/build-all.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nix/build-all.py b/nix/build-all.py index a704ecc3f7..1619486341 100644 --- a/nix/build-all.py +++ b/nix/build-all.py @@ -110,6 +110,7 @@ from __future__ import annotations import argparse import glob +import importlib.util import json import logging import multiprocessing @@ -985,9 +986,7 @@ def install_qt6() -> str: os.makedirs(qt_install_root, exist_ok=True) - try: - import aqt # ty:ignore[unresolved-import] - except ModuleNotFoundError: + if importlib.util.find_spec("aqt") is None: logger.error( "Could not find an existing Qt6 install, so aqtinstall is needed to fetch it automatically. " "Install the `aqtinstall` PyPI package or set QT_DIR."