From d8ad9f9b051151d401ed411bb3338ecb30225f90 Mon Sep 17 00:00:00 2001 From: Iikka Eklund Date: Wed, 25 May 2022 13:16:02 +0300 Subject: [PATCH] Conan: Fix how conans.model.options.PackageOption value is evaluated The default value None returned by tools.get_safe is not the Python's built-in None value. The value returned by tools.get_safe() is wrapped into conans.model.options.PackageOption and to check against 'None' it needs to follow pattern: if not : Change-Id: Idacfdde92958a46d399246239d12cd887916c4f1 Reviewed-by: Toni Saario (cherry picked from commit a536734b9c94b2af10b70d09cb7609b58c5fb908) Reviewed-by: Qt Cherry-pick Bot --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index 58f8dc19f84..1b05a9628c4 100644 --- a/conanfile.py +++ b/conanfile.py @@ -157,7 +157,7 @@ class QtBase(ConanFile): # When cross-building the user needs to pass 'qt_host_path' which is transformed to # QT_HOST_PATH later on. Resolve the exact path. qt_host_path = self.options.get_safe("qt_host_path") - if qt_host_path is None: + if not qt_host_path: raise QtConanError("Expected 'qt_host_path' option in cross-build context") return str(Path(os.path.expandvars(str(qt_host_path))).expanduser().resolve(strict=True))