Skip to content

Commit

Permalink
Ensure override var exists. Closes #13402.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpakkane authored and eli-schwartz committed Jul 23, 2024
1 parent fa70974 commit a97de6b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mesonbuild/coredata.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from itertools import chain
from pathlib import PurePath
from collections import OrderedDict, abc
from dataclasses import dataclass
import dataclasses

from .mesonlib import (
MesonBugException,
Expand Down Expand Up @@ -895,7 +895,7 @@ def parse_cmd_line_options(args: SharedCMDOptions) -> None:
args.cmd_line_options[key] = value
delattr(args, name)

@dataclass
@dataclasses.dataclass
class OptionsView(abc.Mapping):
'''A view on an options dictionary for a given subproject and with overrides.
'''
Expand All @@ -904,7 +904,7 @@ class OptionsView(abc.Mapping):
# python 3.8 or typing_extensions
original_options: T.Union[KeyedOptionDictType, 'dict[OptionKey, UserOption[Any]]']
subproject: T.Optional[str] = None
overrides: T.Optional[T.Mapping[OptionKey, T.Union[str, int, bool, T.List[str]]]] = None
overrides: T.Optional[T.Mapping[OptionKey, T.Union[str, int, bool, T.List[str]]]] = dataclasses.field(default_factory=dict)

def __getitem__(self, key: OptionKey) -> options.UserOption:
# FIXME: This is fundamentally the same algorithm than interpreter.get_option_internal().
Expand Down

0 comments on commit a97de6b

Please sign in to comment.