kopia lustrzana https://github.com/micropython/micropython-lib
upip: get_pkg_metadata: Use ujson.load() to save memory.
rodzic
36744578e2
commit
823b743daf
|
@ -145,9 +145,10 @@ def url_open(url):
|
|||
|
||||
def get_pkg_metadata(name):
|
||||
f = url_open("https://pypi.python.org/pypi/%s/json" % name)
|
||||
s = f.read()
|
||||
f.close()
|
||||
return json.loads(s)
|
||||
try:
|
||||
return json.load(f)
|
||||
finally:
|
||||
f.close()
|
||||
|
||||
|
||||
def fatal(msg, exc=None):
|
||||
|
|
Ładowanie…
Reference in New Issue