Skip to content

Commit f2561da

Browse files
committed
fixes #219
1 parent b9e2710 commit f2561da

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

fastcore/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.3.7"
1+
__version__ = "1.3.8"

fastcore/xtras.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ def urlread(url, data=None, headers=None, **kwargs):
216216
# Cell
217217
def urljson(url, data=None):
218218
"Retrieve `url` and decode json"
219-
return json.loads(urlread(url, data=data))
219+
res = urlread(url, data=data)
220+
return json.loads(res) if res else {}
220221

221222
# Cell
222223
def urlcheck(url, timeout=10):

nbs/03_xtras.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@
588588
{
589589
"data": {
590590
"text/plain": [
591-
"['c', 'h', 'f', 'e', 'g', 'b', 'd', 'a']"
591+
"['e', 'c', 'd', 'b', 'h', 'f', 'g', 'a']"
592592
]
593593
},
594594
"execution_count": null,
@@ -1297,7 +1297,8 @@
12971297
"#export\n",
12981298
"def urljson(url, data=None):\n",
12991299
" \"Retrieve `url` and decode json\"\n",
1300-
" return json.loads(urlread(url, data=data))"
1300+
" res = urlread(url, data=data)\n",
1301+
" return json.loads(res) if res else {}"
13011302
]
13021303
},
13031304
{

settings.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author = Jeremy Howard and Sylvain Gugger
77
author_email = [email protected]
88
copyright = fast.ai
99
branch = master
10-
version = 1.3.7
10+
version = 1.3.8
1111
min_python = 3.6
1212
audience = Developers
1313
language = English

0 commit comments

Comments
 (0)