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

Skip to content

Commit dffe59f

Browse files
authored
Merge pull request #19775 from QuLogic/fix-imread-deprecation
Fix deprecation for imread on URLs.
2 parents bdb7774 + 8f2f97a commit dffe59f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/matplotlib/image.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,9 +1478,10 @@ def imread(fname, format=None):
14781478
if isinstance(fname, str):
14791479
parsed = parse.urlparse(fname)
14801480
if len(parsed.scheme) > 1: # Pillow doesn't handle URLs directly.
1481-
cbook.warn_deprecated(
1481+
_api.warn_deprecated(
14821482
"3.4", message="Directly reading images from URLs is "
1483-
"deprecated. Please open the URL for reading and pass the "
1483+
"deprecated since %(since)s and will no longer be supported "
1484+
"%(removal)s. Please open the URL for reading and pass the "
14841485
"result to Pillow, e.g. with "
14851486
"``PIL.Image.open(urllib.request.urlopen(url))``.")
14861487
# hide imports to speed initial import on systems with slow linkers

0 commit comments

Comments
 (0)