pylint: enable global-variable-not-assigned

The `global` statement is only needed to assign to global variables, not
read or mutate them. So calling `global.mutate()` is fine, but not
`var = foo`, which would otherwise shadow `var`.
pull/10842/head
Dylan Baker 2 years ago committed by Xavier Claessens
parent 1917b9253e
commit 3ef332e89a
  1. 1
      .pylintrc
  2. 1
      mesonbuild/mesonlib/universal.py
  3. 1
      mesonbuild/mlog.py
  4. 1
      mesonbuild/scripts/symbolextractor.py

@ -24,7 +24,6 @@ disable=
exec-used,
fixme,
global-statement,
global-variable-not-assigned,
implicit-str-concat,
import-error,
import-outside-toplevel,

@ -229,7 +229,6 @@ def verbose_git(cmd: T.List[str], workingdir: T.Union[str, bytes, os.PathLike],
return p.returncode == 0
def set_meson_command(mainfile: str) -> None:
global python_command
global _meson_command
# On UNIX-like systems `meson` is a Python script
# On Windows `meson` and `meson.exe` are wrapper exes

@ -396,7 +396,6 @@ def format_list(input_list: T.List[str]) -> str:
@contextmanager
def nested(name: str = '') -> T.Generator[None, None, None]:
global log_depth
log_depth.append(name)
try:
yield

@ -53,7 +53,6 @@ def write_if_changed(text: str, outfilename: str) -> None:
f.write(text)
def print_tool_warning(tools: T.List[str], msg: str, stderr: T.Optional[str] = None) -> None:
global TOOL_WARNING_FILE
if os.path.exists(TOOL_WARNING_FILE):
return
m = f'{tools!r} {msg}. {RELINKING_WARNING}'

Loading…
Cancel
Save