summaryrefslogtreecommitdiff
path: root/cmd2/clipboard.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-09-13 16:25:44 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2019-09-13 16:25:44 -0400
commit8acd840d0920519af4a862648827b8db0b72af76 (patch)
tree7da2043f61a2a0570f85173b9e78670c933b38cf /cmd2/clipboard.py
parentd6643affac0ebf963bfcd9c6fa5ac92cd9bd5cf4 (diff)
parente58b95f2d352d7c02f0e55ff5bd438485cf89174 (diff)
downloadcmd2-git-8acd840d0920519af4a862648827b8db0b72af76.tar.gz
Merge branch 'completion_state' of github.com:python-cmd2/cmd2 into completion_state
Diffstat (limited to 'cmd2/clipboard.py')
-rw-r--r--cmd2/clipboard.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd2/clipboard.py b/cmd2/clipboard.py
index 18370f9a..deb2f5cc 100644
--- a/cmd2/clipboard.py
+++ b/cmd2/clipboard.py
@@ -10,8 +10,9 @@ from pyperclip import PyperclipException
try:
# Try getting the contents of the clipboard
_ = pyperclip.paste()
-except (PyperclipException, FileNotFoundError):
+except (PyperclipException, FileNotFoundError, ValueError):
# NOTE: FileNotFoundError is for Windows Subsystem for Linux (WSL) when Windows paths are removed from $PATH
+ # NOTE: ValueError is for headless Linux systems without Gtk installed
can_clip = False
else:
can_clip = True