Skip to content

Commit 4e76883

Browse files
committed
Fix what is fundamentally a Pyperclip bug on headless Linux systems without Gtk libraries
1 parent d6549c8 commit 4e76883

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## 0.9.17 (TBD, 2019)
22
* Bug Fixes
33
* Fixed a bug when using WSL when all Windows paths have been removed from $PATH
4+
* Fixed a bug when running a cmd2 application on Linux without Gtk libraries installed
45
* Enhancements
56
* No longer treating empty text scripts as an error condition
67

cmd2/clipboard.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
try:
1111
# Try getting the contents of the clipboard
1212
_ = pyperclip.paste()
13-
except (PyperclipException, FileNotFoundError):
13+
except (PyperclipException, FileNotFoundError, ValueError):
1414
# NOTE: FileNotFoundError is for Windows Subsystem for Linux (WSL) when Windows paths are removed from $PATH
15+
# NOTE: ValueError is for headless Linux systems without Gtk installed
1516
can_clip = False
1617
else:
1718
can_clip = True

0 commit comments

Comments
 (0)