We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 87881ce commit bcc804eCopy full SHA for bcc804e
tools/src/main/python/readconfig.py
@@ -26,6 +26,12 @@
26
import yaml
27
import sys
28
29
+# The following is to make the json parsing work on Python 3.4.
30
+try:
31
+ from json.decoder import JSONDecodeError
32
+except ImportError:
33
+ JSONDecodeError = ValueError
34
+
35
36
def read_config(logger, inputfile):
37
"""
@@ -43,7 +49,7 @@ def read_config(logger, inputfile):
43
49
try:
44
50
logger.debug("trying JSON")
45
51
cfg = json.loads(data)
46
- except json.decoder.JSONDecodeError:
52
+ except JSONDecodeError:
47
53
# Not a valid JSON file.
48
54
logger.debug("got exception {}".format(sys.exc_info()[0]))
55
pass
0 commit comments