From a536734b9c94b2af10b70d09cb7609b58c5fb908 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 : Pick-to: 6.3 Change-Id: Idacfdde92958a46d399246239d12cd887916c4f1 Reviewed-by: Toni Saario --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index 2a9f50f8b4..1a7b98cd0d 100644 --- a/conanfile.py +++ b/conanfile.py @@ -132,7 +132,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))