From ffbc4a40573fad1ccd6685d896af930208a769c1 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Thu, 10 Sep 2020 12:56:27 -0600 Subject: dblite tweaks use os.replace instead of the dance around os.rename which behaves differently on Windows. use True/False for flags for clarity. Fix some PEP8 warnings. Signed-off-by: Mats Wichmann --- SCons/SConsign.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'SCons/SConsign.py') diff --git a/SCons/SConsign.py b/SCons/SConsign.py index 8e3ebf4d7..95b809629 100644 --- a/SCons/SConsign.py +++ b/SCons/SConsign.py @@ -35,10 +35,12 @@ from SCons.compat import PICKLE_PROTOCOL def corrupt_dblite_warning(filename): - SCons.Warnings.warn(SCons.Warnings.CorruptSConsignWarning, - "Ignoring corrupt .sconsign file: %s"%filename) + SCons.Warnings.warn( + SCons.Warnings.CorruptSConsignWarning, + "Ignoring corrupt .sconsign file: %s" % filename, + ) -SCons.dblite.ignore_corrupt_dbfiles = 1 +SCons.dblite.IGNORE_CORRUPT_DBFILES = True SCons.dblite.corruption_warning = corrupt_dblite_warning # XXX Get rid of the global array so this becomes re-entrant. @@ -141,7 +143,7 @@ class SConsignEntry: def __getstate__(self): state = getattr(self, '__dict__', {}).copy() for obj in type(self).mro(): - for name in getattr(obj,'__slots__',()): + for name in getattr(obj, '__slots__', ()): if hasattr(self, name): state[name] = getattr(self, name) @@ -154,7 +156,7 @@ class SConsignEntry: def __setstate__(self, state): for key, value in state.items(): - if key not in ('_version_id','__weakref__'): + if key not in ('_version_id', '__weakref__'): setattr(self, key, value) -- cgit v1.2.1