]> Frank Brehm's Git Trees - pixelpark/admin-tools.git/commitdiff
Changed ErrorClass in parsing of json files in pp_lib/cfg_app.py
authorFrank Brehm <frank.brehm@pixelpark.com>
Mon, 20 Mar 2017 08:42:55 +0000 (09:42 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Mon, 20 Mar 2017 08:42:55 +0000 (09:42 +0100)
pp_lib/cfg_app.py

index 08cfea47e835a3a32ea68101c4ce000cad6c4ee2..af43199e1b66ea5022b08570fc9187a2340370de 100644 (file)
@@ -20,8 +20,6 @@ import textwrap
 import datetime
 import json
 
-from json import JSONDecodeError
-
 # Third party modules
 import six
 
@@ -43,7 +41,7 @@ from .merge import merge_structure
 
 from .app import PpApplication
 
-__version__ = '0.4.2'
+__version__ = '0.4.3'
 LOG = logging.getLogger(__name__)
 
 
@@ -322,7 +320,7 @@ class PpConfigApplication(PpApplication):
             with open(cfg_file, 'r', **open_opts) as fh:
                 try:
                     log_cfg = json.load(fh)
-                except JSONDecodeError as e:
+                except (ValueError, TypeError) as e:
                     msg = "Wrong file {!r} - ".format(cfg_file) + str(e)
                     self.handle_error(msg, e.__class__.__name__)
                     continue