summaryrefslogtreecommitdiff
path: root/cmd2
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-09-07 10:16:21 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2019-09-07 10:16:21 -0400
commite58b95f2d352d7c02f0e55ff5bd438485cf89174 (patch)
tree1c73b6bef88cfd44ade5787c24c4ec16e5c888f7 /cmd2
parent294d911f3625e8c6f97937cdce964a2ce340aecd (diff)
parent693ec59719edc4384739392a0daea73c922b91c3 (diff)
downloadcmd2-git-e58b95f2d352d7c02f0e55ff5bd438485cf89174.tar.gz
Merge branch 'master' into completion_state
Diffstat (limited to 'cmd2')
-rw-r--r--cmd2/clipboard.py3
-rwxr-xr-xcmd2/cmd2.py2
2 files changed, 3 insertions, 2 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
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index 900a4c75..c7b759c1 100755
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -2056,7 +2056,7 @@ class Cmd(cmd.Cmd):
elif statement.output:
import tempfile
if (not statement.output_to) and (not self._can_clip):
- self.perror("Cannot redirect to paste buffer; install 'pyperclip' and re-run to enable")
+ self.perror("Cannot redirect to paste buffer; missing 'pyperclip' and/or pyperclip dependencies")
redir_error = True
elif statement.output_to: