replace JSONDecodeError with ValueError
This commit is contained in:
@@ -79,7 +79,7 @@ def parse_option(opt):
|
|||||||
key, value = opt.split("=", 1)
|
key, value = opt.split("=", 1)
|
||||||
try:
|
try:
|
||||||
value = json.loads(value)
|
value = json.loads(value)
|
||||||
except json.decoder.JSONDecodeError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
config.set(key.split("."), value)
|
config.set(key.split("."), value)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ def load(*files, strict=False):
|
|||||||
if strict:
|
if strict:
|
||||||
raise
|
raise
|
||||||
continue
|
continue
|
||||||
except json.decoder.JSONDecodeError as exception:
|
except ValueError as exception:
|
||||||
print("Error while loading '", path, "':", sep="", file=sys.stderr)
|
print("Error while loading '", path, "':", sep="", file=sys.stderr)
|
||||||
print(exception, file=sys.stderr)
|
print(exception, file=sys.stderr)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user