pylint: enable used-before-assignment

The one case of this was a false-positive, but what we were doing
(checking locals()) is not idiomatic. I've replaced the call to
`locals()` with the obvious `var: T.Optional[str] = None` with check
instead.
pull/11117/head
Dylan Baker 2 years ago committed by Eli Schwartz
parent e8727fc857
commit 5794805f8e
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 1
      .pylintrc
  2. 4
      mesonbuild/msetup.py

@ -74,7 +74,6 @@ disable=
unused-argument,
unused-variable,
use-implicit-booleaness-not-comparison,
used-before-assignment,
useless-return,
useless-super-delegation,
wrong-import-order,

@ -231,6 +231,8 @@ class MesonApp:
except Exception as e:
mintro.write_meson_info_file(b, [e])
raise
cdf: T.Optional[str] = None
try:
dumpfile = os.path.join(env.get_scratch_dir(), 'build.dat')
# We would like to write coredata as late as possible since we use the existence of
@ -281,7 +283,7 @@ class MesonApp:
except Exception as e:
mintro.write_meson_info_file(b, [e])
if 'cdf' in locals():
if cdf is not None:
old_cdf = cdf + '.prev'
if os.path.exists(old_cdf):
os.replace(old_cdf, cdf)

Loading…
Cancel
Save