From c5d2c7f48a2f2a02a40d0dfca72e080087aa5d12 Mon Sep 17 00:00:00 2001 From: cclauss Date: Mon, 5 Mar 2018 21:23:47 +0100 Subject: [PATCH] Declare global variables that are created elsewhere --- lib/matplotlib/backends/backend_webagg.py | 2 ++ lib/matplotlib/backends/backend_wx.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/matplotlib/backends/backend_webagg.py b/lib/matplotlib/backends/backend_webagg.py index 137cda2aa009..fad6de97012d 100644 --- a/lib/matplotlib/backends/backend_webagg.py +++ b/lib/matplotlib/backends/backend_webagg.py @@ -45,12 +45,14 @@ class ServerThread(threading.Thread): def run(self): tornado.ioloop.IOLoop.instance().start() + webagg_server_thread = ServerThread() class FigureCanvasWebAgg(core.FigureCanvasWebAggCore): def show(self): # show the figure window + global show # placates pyflakes: created by @_Backend.export below show() def new_timer(self, *args, **kwargs): diff --git a/lib/matplotlib/backends/backend_wx.py b/lib/matplotlib/backends/backend_wx.py index 6fbc6b716f6c..ed61e14af9c7 100644 --- a/lib/matplotlib/backends/backend_wx.py +++ b/lib/matplotlib/backends/backend_wx.py @@ -1456,6 +1456,7 @@ def updateButtonText(self, lst): @cbook.deprecated("2.2") class SubplotToolWX(wx.Frame): def __init__(self, targetfig): + global FigureManager # placates pyflakes: created by @_Backend.export wx.Frame.__init__(self, None, -1, "Configure subplots") toolfig = Figure((6, 3)) @@ -1519,6 +1520,7 @@ def pan(self, *args): NavigationToolbar2.pan(self, *args) def configure_subplots(self, evt): + global FigureManager # placates pyflakes: created by @_Backend.export frame = wx.Frame(None, -1, "Configure subplots") toolfig = Figure((6, 3))