File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 1+ ## 2.3.4 (TBD, 2021)
2+ * Enhancements
3+ * Added broader exception handling when enabling clipboard functionality via ` pyperclip ` .
4+
15## 2.3.3 (November 29, 2021)
26* Enhancements
37 * Added clearer exception handling to ` BorderedTable ` and ` SimpleTable ` .
Original file line number Diff line number Diff line change 99import pyperclip # type: ignore[import]
1010
1111# noinspection PyProtectedMember
12- from pyperclip import (
13- PyperclipException ,
14- )
1512
1613# Can we access the clipboard? Should always be true on Windows and Mac, but only sometimes on Linux
14+ # noinspection PyBroadException
1715try :
1816 # Try getting the contents of the clipboard
1917 _ = pyperclip .paste ()
20- except (PyperclipException , FileNotFoundError , ValueError ):
21- # NOTE: FileNotFoundError is for Windows Subsystem for Linux (WSL) when Windows paths are removed from $PATH
22- # NOTE: ValueError is for headless Linux systems without Gtk installed
18+
19+ # pyperclip raises at least the following types of exceptions. To be safe, just catch all Exceptions.
20+ # FileNotFoundError on Windows Subsystem for Linux (WSL) when Windows paths are removed from $PATH
21+ # ValueError for headless Linux systems without Gtk installed
22+ # AssertionError can be raised by paste_klipper().
23+ # PyperclipException for pyperclip-specific exceptions
24+ except Exception :
2325 can_clip = False
2426else :
2527 can_clip = True
Original file line number Diff line number Diff line change @@ -4086,7 +4086,7 @@ def do_shell(self, args: argparse.Namespace) -> None:
40864086 self .last_result = proc .returncode
40874087
40884088 # If the process was stopped by Ctrl-C, then inform the caller by raising a KeyboardInterrupt.
4089- # This is to support things like stop_on_keyboard_interrupt in run_cmds_plus_hooks ().
4089+ # This is to support things like stop_on_keyboard_interrupt in runcmds_plus_hooks ().
40904090 if proc .returncode == ctrl_c_ret_code :
40914091 self ._raise_keyboard_interrupt ()
40924092
You can’t perform that action at this time.
0 commit comments