diff options
author | Iikka Eklund <iikka.eklund@qt.io> | 2022-05-25 13:16:02 +0300 |
---|---|---|
committer | Iikka Eklund <iikka.eklund@qt.io> | 2022-05-27 07:17:21 +0300 |
commit | a536734b9c94b2af10b70d09cb7609b58c5fb908 (patch) | |
tree | b76a7733952b2962184f8431a0e9203c3161ee76 /conanfile.py | |
parent | 42fe677584dc672f63c2efc812005e3a49f82d10 (diff) |
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 <value>:
Pick-to: 6.3
Change-Id: Idacfdde92958a46d399246239d12cd887916c4f1
Reviewed-by: Toni Saario <toni.saario@qt.io>
Diffstat (limited to 'conanfile.py')
-rw-r--r-- | conanfile.py | 2 |
1 files changed, 1 insertions, 1 deletions
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)) |