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.
2 parents 99dbc8b + 33dd3fe commit e9d225bCopy full SHA for e9d225b
tools/utils.py
@@ -196,8 +196,12 @@ def dict_to_ascii(input):
196
# Read a JSON file and return its Python representation, transforming all the strings from Unicode
197
# to ASCII. The order of keys in the JSON file is preserved.
198
def json_file_to_dict(fname):
199
- with open(fname, "rt") as f:
200
- return dict_to_ascii(json.load(f, object_pairs_hook=OrderedDict))
+ try:
+ with open(fname, "rt") as f:
201
+ return dict_to_ascii(json.load(f, object_pairs_hook=OrderedDict))
202
+ except (ValueError, IOError):
203
+ sys.stderr.write("Error parsing '%s':\n" % fname)
204
+ raise
205
206
# Wowza, double closure
207
def argparse_type(casedness, prefer_hyphen=False) :
0 commit comments