mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-03 19:03:24 +00:00
Improve completion in IPython/Python 3.13
IPython/Python 3.13 indirectly imports rlcompleter, and the completer is set up to reference rlcompleter.__main__. However, this rlcompleter.__main__ is different from the __main__ in the REPL execution. Therefore, this completer cannot correctly complete the REPL globals. To address this issue, we override rlcompleter.__main__ with __main__ only in the case of IPython. * lisp/progmodes/python.el (python-shell-completion-native-setup): Modify __PYTHON_EL_native_completion_setup(). (Bug#76205)
This commit is contained in:
parent
c180966b31
commit
a75f4449fa
1 changed files with 7 additions and 0 deletions
|
@ -4537,6 +4537,13 @@ def __PYTHON_EL_native_completion_setup():
|
|||
if not is_ipython:
|
||||
readline.set_completer(new_completer)
|
||||
else:
|
||||
# Ensure that rlcompleter.__main__ and __main__ are identical.
|
||||
# (Bug#76205)
|
||||
import sys
|
||||
try:
|
||||
sys.modules['rlcompleter'].__main__ = sys.modules['__main__']
|
||||
except KeyError:
|
||||
pass
|
||||
# Try both initializations to cope with all IPython versions.
|
||||
# This works fine for IPython 3.x but not for earlier:
|
||||
readline.set_completer(new_completer)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue