From eff0f2dacdad01140e66bc998ba35bc520882bc2 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Thu, 9 Sep 2021 10:24:18 +0200 Subject: [geldschieberbot] close the state file after reading --- geldschieberbot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3