Catch 'clipboard already open' errors in editors
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Wed, 27 Jun 2018 13:57:03 +0300
changeset 2233 32445e3c9cfc
parent 2232 3220dd020675
child 2234 3da336a9664c
Catch 'clipboard already open' errors in editors

Apparently following commits have not fixed the problem completely,
because it still happens (although not so often).

changeset: 2019:b8f795bdfe9f
user: Andrey Skvortsov <andrej.skvortzov@gmail.com>
date: Fri May 25 17:40:29 2018 +0300
summary: fix hangs on mouse selection in case if wxPython uses wxWidgets with GTK3+ support

changeset: 2018:5ce6d08ff2c7
user: Andrey Skvortsov <andrej.skvortzov@gmail.com>
date: Fri May 25 17:23:15 2018 +0300
summary: make clipboard open minimal time as wxPython documentation recommends
IDEFrame.py
--- a/IDEFrame.py	Wed Jun 27 10:58:45 2018 +0300
+++ b/IDEFrame.py	Wed Jun 27 13:57:03 2018 +0300
@@ -944,7 +944,11 @@
         if not wx.TheClipboard.IsOpened():
             dataobj = wx.TextDataObject()
             if wx.TheClipboard.Open():
-                success = wx.TheClipboard.GetData(dataobj)
+                success = False
+                try:
+                    success = wx.TheClipboard.GetData(dataobj)
+                except wx._core.PyAssertionError:
+                    pass
                 wx.TheClipboard.Close()
                 if success:
                     data = dataobj.GetText()