mesonlib: make get_meson_command return an ImmutableList

We really don't want to be mutating global state, so let mypy yell at us
when we try.
pull/9738/head
Dylan Baker 3 years ago committed by Eli Schwartz
parent c5148d8c73
commit e13d92bb6a
  1. 4
      mesonbuild/mesonlib/universal.py

@ -155,7 +155,7 @@ if os.path.basename(sys.executable) == 'meson.exe':
python_command = [sys.executable, 'runpython'] python_command = [sys.executable, 'runpython']
else: else:
python_command = [sys.executable] python_command = [sys.executable]
_meson_command = None _meson_command: T.Optional['ImmutableListProtocol[str]'] = None
class MesonException(Exception): class MesonException(Exception):
'''Exceptions thrown by Meson''' '''Exceptions thrown by Meson'''
@ -230,7 +230,7 @@ def set_meson_command(mainfile: str) -> None:
mlog.log(f'meson_command is {_meson_command!r}') mlog.log(f'meson_command is {_meson_command!r}')
def get_meson_command() -> T.Optional[T.List[str]]: def get_meson_command() -> T.Optional['ImmutableListProtocol[str]']:
return _meson_command return _meson_command

Loading…
Cancel
Save