From 768712cf32e82ee9e82e6d567f2a39677b48e46c Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 4 Apr 2025 10:00:19 -0700 Subject: options: fix an assertion that is incorrect The key can be an OptionKey, particularly in the next patch. --- mesonbuild/options.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mesonbuild/options.py b/mesonbuild/options.py index 8a7b7ec3b..2f7663af3 100644 --- a/mesonbuild/options.py +++ b/mesonbuild/options.py @@ -1323,8 +1323,10 @@ class OptionStore: # # The key parsing function can not handle the difference between the two # and defaults to A. - assert isinstance(keystr, str) - key = OptionKey.from_string(keystr) + if isinstance(keystr, str): + key = OptionKey.from_string(keystr) + else: + key = keystr # Due to backwards compatibility we ignore all cross options when building # natively. if not self.is_cross and key.is_for_build(): -- cgit v1.2.3