summaryrefslogtreecommitdiff
path: root/cmd2.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2018-03-21 17:24:30 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2018-03-21 17:24:30 -0400
commitbaccdf51b450ca3e185a2a5e8890c0af81bfebbb (patch)
tree359409261c5e257faa3804b613c00e3a44f30811 /cmd2.py
parent2ad05870d1b1b7f30c24e8fbc4383d836b7010b3 (diff)
parent4cea62a8fb7f5da3cfd4ee32fde831f401c128dc (diff)
downloadcmd2-git-baccdf51b450ca3e185a2a5e8890c0af81bfebbb.tar.gz
Merge branch 'master' into new_quoted_completion
Diffstat (limited to 'cmd2.py')
-rwxr-xr-xcmd2.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/cmd2.py b/cmd2.py
index 13f22273..26d877ba 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -113,13 +113,17 @@ try:
except ImportError:
ipython_available = False
-# Try to import readline, but allow failure for convenience in Windows unit testing
-# Note: If this actually fails, you should install readline on Linux or Mac or pyreadline on Windows
+# Prefer statically linked gnureadline if available (for macOS compatibility due to issues with libedit)
try:
- # noinspection PyUnresolvedReferences
- import readline
+ import gnureadline as readline
except ImportError:
- pass
+ # Try to import readline, but allow failure for convenience in Windows unit testing
+ # Note: If this actually fails, you should install readline on Linux or Mac or pyreadline on Windows
+ try:
+ # noinspection PyUnresolvedReferences
+ import readline
+ except ImportError:
+ pass
# Load the GNU readline lib so we can make changes to it
readline_lib = None