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 1de934d commit 9021018Copy full SHA for 9021018
heudiconv/utils.py
@@ -14,6 +14,11 @@
14
from glob import glob
15
from subprocess import check_output
16
17
+try:
18
+ from json.decoder import JSONDecodeError
19
+except ImportError:
20
+ JSONDecodeError = ValueError
21
+
22
from nipype.utils.filemanip import which
23
24
import logging
@@ -175,11 +180,12 @@ def load_json(filename):
175
180
try:
176
181
with open(filename, 'r') as fp:
177
182
data = json.load(fp)
178
- except json.JSONDecodeError:
183
+ except JSONDecodeError:
179
184
print("{fname} is not a valid json file".format(fname=filename))
185
raise
-
186
187
+ return data
188
189
190
def assure_no_file_exists(path):
191
"""Check if file or symlink (git-annex?) exists, and if so -- remove"""
0 commit comments