Skip to content

Commit

Permalink
Merge pull request ipython#5869 from takluyver/win32clipboard-catch-m…
Browse files Browse the repository at this point in the history
…ore-errs

Catch more errors from clipboard access on Windows
  • Loading branch information
takluyver committed May 16, 2014
2 parents fdff024 + d315c8f commit 9609766
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions IPython/lib/clipboard.py
Expand Up @@ -22,11 +22,11 @@ def win32_clipboard_get():
win32clipboard.OpenClipboard()
try:
text = win32clipboard.GetClipboardData(win32clipboard.CF_UNICODETEXT)
except TypeError:
except (TypeError, win32clipboard.error):
try:
text = win32clipboard.GetClipboardData(win32clipboard.CF_TEXT)
text = py3compat.cast_unicode(text, py3compat.DEFAULT_ENCODING)
except TypeError:
except (TypeError, win32clipboard.error):
raise ClipboardEmpty
finally:
win32clipboard.CloseClipboard()
Expand Down

0 comments on commit 9609766

Please sign in to comment.