Skip to content

Commit

Permalink
Merge pull request #182 from christian-monch/issue-181-replace-simple…
Browse files Browse the repository at this point in the history
…json

Replace `simplejson` with `json`
  • Loading branch information
yarikoptic authored Sep 20, 2022
2 parents 0efcbba + 535b38d commit cc461e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions datalad_container/containers_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

__docformat__ = 'restructuredtext'

import re
import json
import logging
import os
import os.path as op
import re
import sys
from shutil import copyfile
from simplejson import loads

from datalad.cmd import WitlessRunner
from datalad.interface.base import Interface
Expand Down Expand Up @@ -48,7 +48,7 @@ def _resolve_img_url(url):
req = requests.get(
'https://www.singularity-hub.org/api/container/{}'.format(
url[7:]))
shub_info = loads(req.text)
shub_info = json.loads(req.text)
url = shub_info['image']
return url

Expand Down
6 changes: 3 additions & 3 deletions datalad_container/containers_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ def __call__(cmd, container_name=None, dataset=None,

# Temporary kludge to give a more helpful message
if callspec.startswith("["):
import simplejson
import json
try:
simplejson.loads(callspec)
except simplejson.errors.JSONDecodeError:
json.loads(callspec)
except json.JSONDecodeError:
pass # Never mind, false positive.
else:
raise ValueError(
Expand Down

0 comments on commit cc461e7

Please sign in to comment.