diff options
Diffstat (limited to 'mesonbuild')
| -rw-r--r-- | mesonbuild/coredata.py | 2 | ||||
| -rw-r--r-- | mesonbuild/interpreter/interpreter.py | 14 | ||||
| -rw-r--r-- | mesonbuild/options.py | 18 |
3 files changed, 17 insertions, 17 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py index 8e47322b8..0ec59b981 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py @@ -351,7 +351,7 @@ class CoreData: # key and target have the same subproject for consistency. # Now just do this to get things going. newkey = newkey.evolve(subproject=target.subproject) - (option_object, value) = self.optstore.get_value_object_and_value_for(newkey) + option_object, value = self.optstore.get_option_and_value_for(newkey) override = target.get_override(newkey.name) if override is not None: return option_object.validate_value(override) diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 3e1010471..437018424 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -1078,28 +1078,28 @@ class Interpreter(InterpreterBase, HoldableObject): if optname_regex.search(optname.split('.', maxsplit=1)[-1]) is not None: raise InterpreterException(f'Invalid option name {optname!r}') - value_object: T.Optional[options.AnyOptionType] + option_object: T.Optional[options.AnyOptionType] try: optkey = options.OptionKey.from_string(optname).evolve(subproject=self.subproject) - value_object, value = self.coredata.optstore.get_value_object_and_value_for(optkey) + option_object, value = self.coredata.optstore.get_option_and_value_for(optkey) except KeyError: if self.coredata.optstore.is_base_option(optkey): # Due to backwards compatibility return the default # option for base options instead of erroring out. - value_object = options.COMPILER_BASE_OPTIONS[optkey.evolve(subproject=None, machine=MachineChoice.HOST)] - value = value_object.default + option_object = options.COMPILER_BASE_OPTIONS[optkey.evolve(subproject=None, machine=MachineChoice.HOST)] + value = option_object.default else: if self.subproject: raise MesonException(f'Option {optname} does not exist for subproject {self.subproject}.') raise MesonException(f'Option {optname} does not exist.') - if isinstance(value_object, options.UserFeatureOption): - ocopy = copy.copy(value_object) + if isinstance(option_object, options.UserFeatureOption): + ocopy = copy.copy(option_object) ocopy.name = optname ocopy.value = value return ocopy elif optname == 'b_sanitize': - assert isinstance(value_object, options.UserStringArrayOption) + assert isinstance(option_object, options.UserStringArrayOption) # To ensure backwards compatibility this always returns a string. # We may eventually want to introduce a new "format" kwarg that # allows the user to modify this behaviour, but for now this is diff --git a/mesonbuild/options.py b/mesonbuild/options.py index a37573626..1f7bf9f03 100644 --- a/mesonbuild/options.py +++ b/mesonbuild/options.py @@ -863,21 +863,21 @@ class OptionStore: return self.options[parent_key] return potential - def get_value_object_and_value_for(self, key: OptionKey) -> T.Tuple[AnyOptionType, ElementaryOptionValues]: + def get_option_and_value_for(self, key: OptionKey) -> T.Tuple[AnyOptionType, ElementaryOptionValues]: assert isinstance(key, OptionKey) key = self.ensure_and_validate_key(key) - vobject = self.resolve_option(key) - computed_value = vobject.value + option_object = self.resolve_option(key) + computed_value = option_object.value if key in self.augments: assert key.subproject is not None computed_value = self.augments[key] - elif vobject.yielding: - computed_value = vobject.parent.value - return (vobject, computed_value) + elif option_object.yielding: + computed_value = option_object.parent.value + return (option_object, computed_value) def option_has_value(self, key: OptionKey, value: ElementaryOptionValues) -> bool: - vobject, current_value = self.get_value_object_and_value_for(key) - return vobject.validate_value(value) == current_value + option_object, current_value = self.get_option_and_value_for(key) + return option_object.validate_value(value) == current_value def get_value_for(self, name: 'T.Union[OptionKey, str]', subproject: T.Optional[str] = None) -> ElementaryOptionValues: if isinstance(name, str): @@ -885,7 +885,7 @@ class OptionStore: else: assert subproject is None key = name - vobject, resolved_value = self.get_value_object_and_value_for(key) + _, resolved_value = self.get_option_and_value_for(key) return resolved_value def add_system_option(self, key: T.Union[OptionKey, str], valobj: AnyOptionType) -> None: |
