Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5f88fb2

Browse files
committed
Fix import
1 parent d4dbe51 commit 5f88fb2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/image.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,8 +1380,8 @@ def read_png(*args, **kwargs):
13801380
parsed = urllib.parse.urlparse(fname)
13811381
# If fname is a URL, download the data
13821382
if len(parsed.scheme) > 1:
1383-
import urllib.request
1384-
fd = BytesIO(urllib.request.urlopen(fname).read())
1383+
from urllib import request
1384+
fd = BytesIO(request.urlopen(fname).read())
13851385
return handler(fd)
13861386
else:
13871387
with open(fname, 'rb') as fd:

0 commit comments

Comments
 (0)