summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-01-04 14:39:58 -0500
committerGitHub <noreply@github.com>2018-01-04 14:39:58 -0500
commit5f976639ee947a83dadf888e1307401980d01434 (patch)
treed54727ea2ee18d256f5559cfaa991abb8158a243 /cmd2.py
parent63b0c6b3a92cab837a71bbad78e777c522823c93 (diff)
parentc447ee4b1bff681396a4c6bff54decd6ce852e55 (diff)
downloadcmd2-git-0.7.9.tar.gz
Merge pull request #243 from python-cmd2/release_prep0.7.9
Abandoned official support for Python 3.3
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/cmd2.py b/cmd2.py
index c7c54e26..54072d99 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -53,16 +53,6 @@ except ImportError:
# noinspection PyUnresolvedReferences
from pyperclip import PyperclipException
-# 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:
- 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
@@ -105,7 +95,18 @@ if six.PY3:
else:
BROKEN_PIPE_ERROR = IOError
-__version__ = '0.7.9a'
+# 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.
+if six.PY2 and sys.platform.startswith('lin'):
+ try:
+ # noinspection PyUnresolvedReferences
+ import gtk
+ gtk.set_interactive(0)
+ except ImportError:
+ pass
+
+__version__ = '0.7.9'
# Pyparsing enablePackrat() can greatly speed up parsing, but problems have been seen in Python 3 in the past
pyparsing.ParserElement.enablePackrat()