summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py8
1 files changed, 7 insertions, 1 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: