From 6178fa809f316c905132eeeb0d2e155deb4db058 Mon Sep 17 00:00:00 2001 From: BlueGreenMagick Date: Fri, 6 Mar 2020 13:03:38 +0900 Subject: [PATCH] fix bug in config_make_valid --- __init__.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index fa1b506..60810b7 100644 --- a/__init__.py +++ b/__init__.py @@ -63,11 +63,18 @@ def config_make_valid(): } changed = False + + # Remove wrong key. + key_to_pop = [] for key in sfmt: if key not in default_sfmt: - sfmt.pop(key) + key_to_pop.append(key) changed = True + for key in key_to_pop: + sfmt.pop(key) + + # Add keys on update / wrong deletion. for key in default_sfmt: if key not in sfmt: sfmt[key] = default_sfmt[key]