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

Skip to content

Commit 1b5fa40

Browse files
committed
Move toolmanager warning from logging to warning.
Using warnings.warn avoids emitting the warning once per Tool, i.e. a dozen times at each invocation. (Yes, the system is experimental, we got that part.) Also update the warning message (Matplotlib 2.1 is long past).
1 parent 9332a06 commit 1b5fa40

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/backend_tools.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ class ToolBase(object):
7777
"""
7878

7979
def __init__(self, toolmanager, name):
80-
_log.warning('Treat the new Tool classes introduced in v1.5 as '
81-
'experimental for now, the API will likely change in '
82-
'version 2.1, and some tools might change name')
80+
cbook._warn_external(
81+
'The new Tool classes introduced in v1.5 are experimental; their '
82+
'API (including names) will likely change in future versions.')
8383
self._name = name
8484
self._toolmanager = toolmanager
8585
self._figure = None

0 commit comments

Comments
 (0)