diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2021-09-09 10:24:18 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2021-09-09 10:24:18 +0200 |
| commit | eff0f2dacdad01140e66bc998ba35bc520882bc2 (patch) | |
| tree | bbf496dac379522495f0afeddfb32f49e527c5a7 | |
| parent | 08d3012d9f8b251f051836d31d171bb820d02f6e (diff) | |
| download | geldschieberbot-eff0f2dacdad01140e66bc998ba35bc520882bc2.tar.gz geldschieberbot-eff0f2dacdad01140e66bc998ba35bc520882bc2.zip | |
[geldschieberbot] close the state file after reading
| -rw-r--r-- | geldschieberbot.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/geldschieberbot.py b/geldschieberbot.py index 93766fe..fb002fa 100644 --- a/geldschieberbot.py +++ b/geldschieberbot.py @@ -11,7 +11,8 @@ import tanken state_file = os.environ["GSB_STATE_FILE"] if os.path.isfile(state_file): - state = json.load(open(state_file, "r")) + with open(state_file, "r") as state_f: + state = json.load(state_f) else: # Dict containing the whole state of geldschieberbot # balance - dict of dicts associating two persons to an amount |
