File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 3
3
# lib/matplotlib/backends/web_backend/nbagg_uat.ipynb to help verify
4
4
# that changes made maintain expected behaviour.
5
5
6
+ import datetime
6
7
from base64 import b64encode
7
8
import json
8
9
import io
@@ -171,7 +172,6 @@ def clearup_closed(self):
171
172
172
173
class TimerTornado (TimerBase ):
173
174
def _timer_start (self ):
174
- import datetime
175
175
self ._timer_stop ()
176
176
if self ._single :
177
177
ioloop = tornado .ioloop .IOLoop .instance ()
@@ -182,10 +182,15 @@ def _timer_start(self):
182
182
self ._timer = tornado .ioloop .PeriodicCallback (
183
183
self ._on_timer ,
184
184
self .interval )
185
- self ._timer .start ()
185
+ self ._timer .start ()
186
186
187
187
def _timer_stop (self ):
188
- if self ._timer is not None :
188
+ if self ._timer is None :
189
+ return
190
+ elif self ._single :
191
+ ioloop = tornado .ioloop .IOLoop .instance ()
192
+ ioloop .remove_timeout (self ._timer )
193
+ else :
189
194
self ._timer .stop ()
190
195
self ._timer = None
191
196
You can’t perform that action at this time.
0 commit comments