German-Immersive-Railroading-Community / BackupSystem

Test for membership should be 'not in' FLK-E713
Anti-pattern
Major
2 years ago2 years old
test for membership should be 'not in'
 66    lg.warning('There was something wrong with the data.json; fixing...')
 67if not 'sha' in data.keys():
 68    data['sha'] = {}
 69if not 'last' in data.keys(): 70    lg.warning('No last update date found; setting standard')
 71    data['last'] = '1999-12-01'
 72
test for membership should be 'not in'
 64    lg.warning('data.json not found; creating...')
 65except json.JSONDecodeError:
 66    lg.warning('There was something wrong with the data.json; fixing...')
 67if not 'sha' in data.keys(): 68    data['sha'] = {}
 69if not 'last' in data.keys():
 70    lg.warning('No last update date found; setting standard')