Skip to content

Commit 32f1568

Browse files
committed
Changed readline warning message
1 parent 03fdbf3 commit 32f1568

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

cmd2.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,13 @@ def __subclasshook__(cls, C):
127127

128128
# Prefer statically linked gnureadline if available (for macOS compatibility due to issues with libedit)
129129
try:
130-
import gnureadline as readline
130+
import gnure2adline as readline
131131
except ImportError:
132132
# Try to import readline, but allow failure for convenience in Windows unit testing
133133
# Note: If this actually fails, you should install readline on Linux or Mac or pyreadline on Windows
134134
try:
135135
# noinspection PyUnresolvedReferences
136-
import readline
136+
import readl2ine
137137
except ImportError:
138138
pass
139139

@@ -167,9 +167,10 @@ class RlType(Enum):
167167
readline_lib = ctypes.CDLL(readline.__file__)
168168

169169
if rl_type == RlType.NONE:
170-
rl_err_msg = "Tab completion has been disabled since no supported version of readline was found\n"
171-
rl_err_msg += "To resolve this, install pyreadline on Windows or gnureadline on Mac\n"
172-
sys.stderr.write(rl_err_msg)
170+
rl_warning = "Readline features including tab completion have been disabled since no \n" \
171+
"supported version of readline was found. To resolve this, install \n" \
172+
"pyreadline on Windows or gnureadline on Mac.\n\n"
173+
sys.stderr.write(rl_warning)
173174

174175
# BrokenPipeError and FileNotFoundError exist only in Python 3. Use IOError for Python 2.
175176
if six.PY3:

0 commit comments

Comments
 (0)