mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
Patch #1472854: make the rlcompleter.Completer class usable on non-
UNIX platforms.
This commit is contained in:
parent
208badda27
commit
3583cff5a9
4 changed files with 19 additions and 14 deletions
|
@ -39,7 +39,6 @@ used, and this module (and the readline module) are silently inactive.
|
|||
|
||||
"""
|
||||
|
||||
import readline
|
||||
import __builtin__
|
||||
import __main__
|
||||
|
||||
|
@ -147,4 +146,9 @@ def get_class_members(klass):
|
|||
ret = ret + get_class_members(base)
|
||||
return ret
|
||||
|
||||
readline.set_completer(Completer().complete)
|
||||
try:
|
||||
import readline
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
readline.set_completer(Completer().complete)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue