2626# The workaround for Python environments using libedit is to install the gnureadline Python library.
2727#########################################################################################################################
2828
29- # Prefer statically linked gnureadline if available due to issues with libedit
29+ # Prefer statically linked gnureadline if installed due to compatibility issues with libedit
3030try :
3131 # noinspection PyPackageRequirements
3232 import gnureadline as readline # type: ignore[import]
3333except ImportError :
34- # Try to import readline, but allow failure for convenience in Windows unit testing.
35- # Note: If this actually fails, you should install gnureadline on Linux/Mac or pyreadline on Windows.
34+ # Note: If this actually fails, you should install gnureadline on Linux/Mac or pyreadline3 on Windows.
3635 try :
3736 # noinspection PyUnresolvedReferences
3837 import readline # type: ignore[no-redef]
@@ -57,8 +56,8 @@ class RlType(Enum):
5756# Explanation for why Readline wasn't loaded
5857_rl_warn_reason = ''
5958
60- # The order of this check matters since importing pyreadline/ pyreadline3 will also show readline in the modules list
61- if 'pyreadline' in sys . modules or ' pyreadline3' in sys .modules :
59+ # The order of this check matters since importing pyreadline3 will also show readline in the modules list
60+ if 'pyreadline3' in sys .modules :
6261 rl_type = RlType .PYREADLINE
6362
6463 import atexit
@@ -109,7 +108,7 @@ def enable_win_vt100(handle: HANDLE) -> bool:
109108 vt100_support = vt100_stdout_support and vt100_stderr_support
110109
111110 ############################################################################################################
112- # pyreadline is incomplete in terms of the Python readline API. Add the missing functions we need.
111+ # pyreadline3 is incomplete in terms of the Python readline API. Add the missing functions we need.
113112 ############################################################################################################
114113 # readline.redisplay()
115114 try :
@@ -125,7 +124,7 @@ def enable_win_vt100(handle: HANDLE) -> bool:
125124 # noinspection PyProtectedMember,PyUnresolvedReferences
126125 def pyreadline_remove_history_item (pos : int ) -> None :
127126 """
128- An implementation of remove_history_item() for pyreadline
127+ An implementation of remove_history_item() for pyreadline3
129128 :param pos: The 0-based position in history to remove
130129 """
131130 # Save of the current location of the history cursor
@@ -162,7 +161,7 @@ def pyreadline_remove_history_item(pos: int) -> None:
162161 if not _rl_warn_reason :
163162 _rl_warn_reason = (
164163 "no supported version of readline was found. To resolve this, install\n "
165- "pyreadline on Windows or gnureadline on Linux/Mac."
164+ "pyreadline3 on Windows or gnureadline on Linux/Mac."
166165 )
167166 rl_warning = "Readline features including tab completion have been disabled because\n " + _rl_warn_reason + '\n \n '
168167else :
0 commit comments