We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5e9aa4f + 7011647 commit 3fd308aCopy full SHA for 3fd308a
lib/matplotlib/backends/backend_wx.py
@@ -777,10 +777,13 @@ def Copy_to_Clipboard(self, event=None):
777
"copy bitmap of canvas to system clipboard"
778
bmp_obj = wx.BitmapDataObject()
779
bmp_obj.SetBitmap(self.bitmap)
780
- wx.TheClipboard.Open()
781
- wx.TheClipboard.SetData(bmp_obj)
782
- wx.TheClipboard.Close()
783
- wx.TheClipboard.Flush()
+
+ if not wx.TheClipboard.IsOpened():
+ open_success = wx.TheClipboard.Open()
+ if open_success:
784
+ wx.TheClipboard.SetData(bmp_obj)
785
+ wx.TheClipboard.Close()
786
+ wx.TheClipboard.Flush()
787
788
def Printer_Init(self):
789
"""
0 commit comments