diff options
| author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-08-15 19:28:12 -0400 |
|---|---|---|
| committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-08-15 19:28:12 -0400 |
| commit | 7ef6a8d1cd9802eacb4cb99d1db0c75d06ad75be (patch) | |
| tree | 7dffcfdc79ed290329e657415ffc538a6e779c17 /cmd2.py | |
| parent | 3a58cab25b3ae57899cf317e7260aecdcfc11e62 (diff) | |
| download | cmd2-git-7ef6a8d1cd9802eacb4cb99d1db0c75d06ad75be.tar.gz | |
Added workaround for bug in Python 2 on Linux when pygtk is installed
This bug is exposed by cmd2's dependency on pyperclip and pyperclip's optional dependency on pygtk.
Diffstat (limited to 'cmd2.py')
| -rwxr-xr-x | cmd2.py | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -46,6 +46,14 @@ 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 +try: + import gtk + gtk.set_interactive(0) +except ImportError: + pass + # next(it) gets next item of iterator it. This is a replacement for calling it.next() in Python 2 and next(it) in Py3 from six import next |
