Skip to content

Commit

Permalink
Fix "colour_datasets.utilities.json_open" definition.
Browse files Browse the repository at this point in the history
  • Loading branch information
KelSolaar committed Feb 25, 2022
1 parent 39a4ac6 commit 9940c42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions colour_datasets/utilities/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def json_open(url: str, retries: Integer = 3) -> Dict:
Examples
--------
# Doctests skip for Python 2.x compatibility.
>>> json_open('https://zenodo.org/api/records/3245883')[:38]
>>> json_open('https://zenodo.org/api/records/3245883')
... # doctest: +SKIP
'{"conceptdoi":"10.5281/zenodo.3245882"'
"""
Expand All @@ -224,7 +224,7 @@ def json_open(url: str, retries: Integer = 3) -> Dict:
attempt = 0
while attempt != retries:
try:
data = json.loads(urllib.request.urlopen(url).read())
return json.loads(urllib.request.urlopen(url).read())
except (urllib.error.URLError, ValueError) as error:
attempt += 1
print(
Expand Down

0 comments on commit 9940c42

Please sign in to comment.