* Fixed exception on first search when started without valid config file.
authorUrban Wallasch <urban.wallasch@freenet.de>
Thu, 1 Jul 2021 20:10:53 +0000 (22:10 +0200)
committerUrban Wallasch <urban.wallasch@freenet.de>
Thu, 1 Jul 2021 20:10:53 +0000 (22:10 +0200)
jiten-pai.py

index 620277599e43c8d1fae18b3c947cc977ecf16e3d..9846832dde695040d75d0eb585d45e0690cfaeb1 100755 (executable)
@@ -144,12 +144,11 @@ def _load_cfg():
     try:
         with open(cfname, 'r') as cfgfile:
             cfg.update(json.load(cfgfile))
-            global _dict_lookup
-            _dict_lookup = _dict_lookup_load if cfg['dict_load'] else _dict_lookup_noload
             cfg['cfgfile'] = cfname
-            return
     except Exception as e:
         eprint('_load_cfg:', cfname, str(e))
+    global _dict_lookup
+    _dict_lookup = _dict_lookup_load if cfg['dict_load'] else _dict_lookup_noload
 
 
 ############################################################