handle an OSError exception

This commit is contained in:
Robin Dunn
2020-05-14 16:25:04 -07:00
parent 62f77a2860
commit 6c2251229f

View File

@@ -151,11 +151,13 @@ class ActiveXCtrl(wx.msw.PyAxBaseWindow):
# accelerators can be dealt with the way that the AXControl
# wants them to be done. MSWTranslateMessage is called before
# wxWidgets handles and eats the navigation keys itself.
res = self.ipao.TranslateAccelerator(msg)
if res == hr.S_OK:
return True
else:
return super(ActiveXCtrl, self).MSWTranslateMessage(msg)
try:
res = self.ipao.TranslateAccelerator(msg)
if res == hr.S_OK:
return True
except OSError:
pass
return super(ActiveXCtrl, self).MSWTranslateMessage(msg)
# TBD: Are the focus handlers needed?