From 54a8db503d96f788bca9674d2d594a0a66f95ffd Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Fri, 9 Mar 2018 22:39:00 +0100 Subject: [PATCH] Fix shell completion issues and documentation This issue was raised in #990. The completer was never used in Python3.4+, because it was overwritten by Python's completer. Oddly enough it has always worked in Python2.7/3.3. The documentation was also slightly modified. os.path.join was always a complex beast. --- jedi/api/replstartup.py | 4 ++-- jedi/utils.py | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/jedi/api/replstartup.py b/jedi/api/replstartup.py index 5bfcc8ce..b2dfdcfe 100644 --- a/jedi/api/replstartup.py +++ b/jedi/api/replstartup.py @@ -11,8 +11,8 @@ Then you will be able to use Jedi completer in your Python interpreter:: [GCC 4.6.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import os - >>> os.path.join().split().in # doctest: +SKIP - os.path.join().split().index os.path.join().split().insert + >>> os.path.join('a', 'b').split().in # doctest: +SKIP + ...dex os.path.join().split().insert """ import jedi.utils diff --git a/jedi/utils.py b/jedi/utils.py index 12b36b76..3e924a73 100644 --- a/jedi/utils.py +++ b/jedi/utils.py @@ -108,6 +108,11 @@ def setup_readline(namespace_module=__main__): return None try: + # Need to import this one as well to make sure it's executed before + # this code. This didn't use to be an issue until 3.3. Starting with + # 3.4 this is different, it always overwrites the completer if it's not + # already imported here. + import rlcompleter import readline except ImportError: print("Jedi: Module readline not available.")