From 8f2f97ad1ee8000635403153b68cf7c441b5f145 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 25 Mar 2021 19:18:20 -0400 Subject: [PATCH] Fix deprecation for imread on URLs. --- lib/matplotlib/image.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index 14b3f78f703b..98e2b5eb790a 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -1478,9 +1478,10 @@ def imread(fname, format=None): if isinstance(fname, str): parsed = parse.urlparse(fname) if len(parsed.scheme) > 1: # Pillow doesn't handle URLs directly. - cbook.warn_deprecated( + _api.warn_deprecated( "3.4", message="Directly reading images from URLs is " - "deprecated. Please open the URL for reading and pass the " + "deprecated since %(since)s and will no longer be supported " + "%(removal)s. Please open the URL for reading and pass the " "result to Pillow, e.g. with " "``PIL.Image.open(urllib.request.urlopen(url))``.") # hide imports to speed initial import on systems with slow linkers