diff options
| author | Noam Postavsky | 2017-10-02 22:54:36 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2017-10-02 23:15:43 -0400 |
| commit | b33808ce77ef15c1f233790a2c93d9db4cc588ab (patch) | |
| tree | 1dd6cd1fc51b44617a3a529c9815c63ccb4b4891 /lisp/progmodes/python.el | |
| parent | f6efc067237ff4c531ea1a43b85cd09e78f6ea0c (diff) | |
| download | emacs-b33808ce77ef15c1f233790a2c93d9db4cc588ab.tar.gz emacs-b33808ce77ef15c1f233790a2c93d9db4cc588ab.zip | |
Give more helpful messages for python completion setup failures
* lisp/progmodes/python.el (python-shell-completion-native-setup): In
case the completion setup failed with some exception, print out the
exception type and message. If libedit is detected, raise an
exception, since this is known to fail.
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 365191c56b0..9aa5134ca0d 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -3442,6 +3442,8 @@ def __PYTHON_EL_native_completion_setup(): | |||
| 3442 | instance.rlcomplete = new_completer | 3442 | instance.rlcomplete = new_completer |
| 3443 | 3443 | ||
| 3444 | if readline.__doc__ and 'libedit' in readline.__doc__: | 3444 | if readline.__doc__ and 'libedit' in readline.__doc__: |
| 3445 | raise Exception('''libedit based readline is known not to work, | ||
| 3446 | see etc/PROBLEMS under \"In Inferior Python mode, input is echoed\".''') | ||
| 3445 | readline.parse_and_bind('bind ^I rl_complete') | 3447 | readline.parse_and_bind('bind ^I rl_complete') |
| 3446 | else: | 3448 | else: |
| 3447 | readline.parse_and_bind('tab: complete') | 3449 | readline.parse_and_bind('tab: complete') |
| @@ -3450,7 +3452,9 @@ def __PYTHON_EL_native_completion_setup(): | |||
| 3450 | 3452 | ||
| 3451 | print ('python.el: native completion setup loaded') | 3453 | print ('python.el: native completion setup loaded') |
| 3452 | except: | 3454 | except: |
| 3453 | print ('python.el: native completion setup failed') | 3455 | import sys |
| 3456 | print ('python.el: native completion setup failed, %s: %s' | ||
| 3457 | % sys.exc_info()[:2]) | ||
| 3454 | 3458 | ||
| 3455 | __PYTHON_EL_native_completion_setup()" process) | 3459 | __PYTHON_EL_native_completion_setup()" process) |
| 3456 | (when (and | 3460 | (when (and |