From ff67bfb23163cfab9c8ae401e284d6c2605d8049 Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Wed, 5 Sep 2018 12:13:25 +0200 Subject: [PATCH] Fix deprecation check in wx Timer. Otherwise, breaks e.g. examples/animation/strip_chart.py and likely most of the animation framework, which calls Timer() with no arguments. --- lib/matplotlib/backends/backend_wx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/backends/backend_wx.py b/lib/matplotlib/backends/backend_wx.py index 514038633637..6f836db94a1f 100644 --- a/lib/matplotlib/backends/backend_wx.py +++ b/lib/matplotlib/backends/backend_wx.py @@ -121,7 +121,7 @@ class TimerWx(TimerBase): ''' def __init__(self, *args, **kwargs): - if isinstance(args[0], wx.EvtHandler): + if args and isinstance(args[0], wx.EvtHandler): cbook.warn_deprecated( "3.0", "Passing a wx.EvtHandler as first argument to the " "TimerWx constructor is deprecated since %(version)s.")