File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change 39
39
import errno
40
40
import sys
41
41
42
+ import json as json_module
43
+
42
44
if sys .implementation .name == "circuitpython" :
43
45
44
46
def cast (_t , value ):
@@ -404,9 +406,6 @@ def text(self) -> str:
404
406
405
407
def json (self ) -> Any :
406
408
"""The HTTP content, parsed into a json dictionary"""
407
- # pylint: disable=import-outside-toplevel
408
- import json
409
-
410
409
# The cached JSON will be a list or dictionary.
411
410
if self ._cached :
412
411
if isinstance (self ._cached , (list , dict )):
@@ -417,7 +416,7 @@ def json(self) -> Any:
417
416
418
417
self ._validate_not_gzip ()
419
418
420
- obj = json .load (self ._raw )
419
+ obj = json_module .load (self ._raw )
421
420
if not self ._cached :
422
421
self ._cached = obj
423
422
self .close ()
@@ -588,10 +587,7 @@ def _send_request(
588
587
self ._send (socket , b"\r \n " )
589
588
if json is not None :
590
589
assert data is None
591
- # pylint: disable=import-outside-toplevel
592
- import json
593
-
594
- data = json .dumps (json )
590
+ data = json_module .dumps (json )
595
591
self ._send (socket , b"Content-Type: application/json\r \n " )
596
592
if data :
597
593
if isinstance (data , dict ):
You can’t perform that action at this time.
0 commit comments