summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd2.py b/cmd2.py
index baacabdd..09412ab5 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -46,9 +46,11 @@ from optparse import make_option
import pyparsing
import pyperclip
-# Workaround for gtk interfering when printing from background thread while main
-# thread is blocking in raw_input() in Python 2 on Linux when gtk is installed
+# On some systems, pyperclip will import gtk for its clipboard functionality.
+# The following code is a workaround for gtk interfering with printing from a background
+# thread while the CLI thread is blocking in raw_input() in Python 2 on Linux.
try:
+ # noinspection PyUnresolvedReferences
import gtk
gtk.set_interactive(0)
except ImportError: