##// END OF EJS Templates
Backport PR #5869: Catch more errors from clipboard access on Windows
MinRK -
Show More
@@ -22,11 +22,11 b' def win32_clipboard_get():'
22 win32clipboard.OpenClipboard()
22 win32clipboard.OpenClipboard()
23 try:
23 try:
24 text = win32clipboard.GetClipboardData(win32clipboard.CF_UNICODETEXT)
24 text = win32clipboard.GetClipboardData(win32clipboard.CF_UNICODETEXT)
25 except TypeError:
25 except (TypeError, win32clipboard.error):
26 try:
26 try:
27 text = win32clipboard.GetClipboardData(win32clipboard.CF_TEXT)
27 text = win32clipboard.GetClipboardData(win32clipboard.CF_TEXT)
28 text = py3compat.cast_unicode(text, py3compat.DEFAULT_ENCODING)
28 text = py3compat.cast_unicode(text, py3compat.DEFAULT_ENCODING)
29 except TypeError:
29 except (TypeError, win32clipboard.error):
30 raise ClipboardEmpty
30 raise ClipboardEmpty
31 finally:
31 finally:
32 win32clipboard.CloseClipboard()
32 win32clipboard.CloseClipboard()
General Comments 0
You need to be logged in to leave comments. Login now