updated python completer to allow for initial open paren

This commit is contained in:
Anthony Scopatz 2017-11-08 21:42:58 -05:00
parent 88647b4a8f
commit 65c80f94c1
2 changed files with 16 additions and 1 deletions

15
news/openparen.rst Normal file
View file

@ -0,0 +1,15 @@
**Added:** None
**Changed:** None
**Deprecated:** None
**Removed:** None
**Fixed:**
* Starting a new command with an open parentheses will no longer
throw a traceback when ``$UPDATE_COMPLETIONS_ON_KEYPRESS`` is
``True``.
**Security:** None

View file

@ -169,7 +169,7 @@ def python_signature_complete(prefix, line, end, ctx, filter_func):
return set()
funcname = xt.subexpr_before_unbalanced(front, '(', ')')
val, _ctx = _safe_eval(funcname, ctx)
if val is None and _ctx is None:
if val is None:
return set()
try:
sig = inspect.signature(val)