Skip to content

Commit 5ef90ec

Browse files
methanepablogsal
andauthored
Simplify reading to json
Co-Authored-By: pablogsal <[email protected]>
1 parent 63563b2 commit 5ef90ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Doc/library/pprint.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ let's fetch information about a project from `PyPI <https://pypi.org>`_::
218218
>>> import pprint
219219
>>> from urllib.request import urlopen
220220
>>> with urlopen('https://pypi.org/pypi/sampleproject/json') as resp:
221-
project_info = json.loads(resp.read())
221+
project_info = json.load(resp)
222222

223223
In its basic form, :func:`pprint` shows the whole object::
224224

0 commit comments

Comments
 (0)