summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-04-16 08:29:37 -0700
committerEric Lin <anselor@gmail.com>2018-04-16 15:11:16 -0400
commit21454b296867b0fce9f1afb70ca0476fe4b9ae2f (patch)
treea4b7784d7597dd1502bb57918333d23110309536
parentc99b9a24b24e7d9b9f5b551504ade7cdba4bc18b (diff)
downloadcmd2-git-21454b296867b0fce9f1afb70ca0476fe4b9ae2f.tar.gz
Changed setup.py requirement for pyperclip to >= 1.5.27 instead of 1.6.0
This is to support installation from package managers on older OSes such as Debian 9.
-rwxr-xr-xcmd2.py8
-rwxr-xr-xsetup.py2
2 files changed, 8 insertions, 2 deletions
diff --git a/cmd2.py b/cmd2.py
index 6ac1fee2..54eff811 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -52,8 +52,14 @@ except ImportError:
import pyparsing
import pyperclip
-from pyperclip import PyperclipException
+# Newer versions of pyperclip are released as a single file, but older versions had a more complicated structure
+try:
+ from pyperclip.exceptions import PyperclipException
+except ImportError:
+ # noinspection PyUnresolvedReferences
+ from pyperclip import PyperclipException
+
# Collection is a container that is sizable and iterable
# It was introduced in Python 3.6. We will try to import it, otherwise use our implementation
try:
diff --git a/setup.py b/setup.py
index c231e7ea..88e4cf7d 100755
--- a/setup.py
+++ b/setup.py
@@ -61,7 +61,7 @@ Programming Language :: Python :: Implementation :: PyPy3
Topic :: Software Development :: Libraries :: Python Modules
""".splitlines())))
-INSTALL_REQUIRES = ['pyparsing >= 2.1.0', 'pyperclip >= 1.6.0']
+INSTALL_REQUIRES = ['pyparsing >= 2.1.0', 'pyperclip >= 1.5.27']
EXTRAS_REQUIRE = {
# Windows also requires pyreadline to ensure tab completion works