aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/ipython/py3/IPython/lib/clipboard.py
diff options
context:
space:
mode:
authorrobot-contrib <robot-contrib@yandex-team.ru>2022-05-18 00:43:36 +0300
committerrobot-contrib <robot-contrib@yandex-team.ru>2022-05-18 00:43:36 +0300
commit9e5f436a8b2a27bcc7802e443ea3ef3e41a82a75 (patch)
tree78b522cab9f76336e62064d4d8ff7c897659b20e /contrib/python/ipython/py3/IPython/lib/clipboard.py
parent8113a823ffca6451bb5ff8f0334560885a939a24 (diff)
downloadydb-9e5f436a8b2a27bcc7802e443ea3ef3e41a82a75.tar.gz
Update contrib/python/ipython/py3 to 8.3.0
ref:e84342d4d30476f9148137f37fd0c6405fd36f55
Diffstat (limited to 'contrib/python/ipython/py3/IPython/lib/clipboard.py')
-rw-r--r--contrib/python/ipython/py3/IPython/lib/clipboard.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/contrib/python/ipython/py3/IPython/lib/clipboard.py b/contrib/python/ipython/py3/IPython/lib/clipboard.py
index 316a8ab1f8..95a6b0a0a3 100644
--- a/contrib/python/ipython/py3/IPython/lib/clipboard.py
+++ b/contrib/python/ipython/py3/IPython/lib/clipboard.py
@@ -16,9 +16,9 @@ def win32_clipboard_get():
"""
try:
import win32clipboard
- except ImportError:
+ except ImportError as e:
raise TryNext("Getting text from the clipboard requires the pywin32 "
- "extensions: http://sourceforge.net/projects/pywin32/")
+ "extensions: http://sourceforge.net/projects/pywin32/") from e
win32clipboard.OpenClipboard()
try:
text = win32clipboard.GetClipboardData(win32clipboard.CF_UNICODETEXT)
@@ -26,8 +26,8 @@ def win32_clipboard_get():
try:
text = win32clipboard.GetClipboardData(win32clipboard.CF_TEXT)
text = py3compat.cast_unicode(text, py3compat.DEFAULT_ENCODING)
- except (TypeError, win32clipboard.error):
- raise ClipboardEmpty
+ except (TypeError, win32clipboard.error) as e:
+ raise ClipboardEmpty from e
finally:
win32clipboard.CloseClipboard()
return text
@@ -52,15 +52,15 @@ def tkinter_clipboard_get():
"""
try:
from tkinter import Tk, TclError
- except ImportError:
- raise TryNext("Getting text from the clipboard on this platform requires tkinter.")
+ except ImportError as e:
+ raise TryNext("Getting text from the clipboard on this platform requires tkinter.") from e
root = Tk()
root.withdraw()
try:
text = root.clipboard_get()
- except TclError:
- raise ClipboardEmpty
+ except TclError as e:
+ raise ClipboardEmpty from e
finally:
root.destroy()
text = py3compat.cast_unicode(text, py3compat.DEFAULT_ENCODING)