From d7729981eecb69bfebeba261ed45a89b098b014a Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Sun, 31 May 2015 09:08:10 -0500 Subject: [PATCH] IPython Console: Fix error when trying to grab signature from docstring Fixes #2341 --- spyderlib/widgets/ipython.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spyderlib/widgets/ipython.py b/spyderlib/widgets/ipython.py index c774554616c..d51e079eaad 100644 --- a/spyderlib/widgets/ipython.py +++ b/spyderlib/widgets/ipython.py @@ -260,7 +260,8 @@ def get_signature(self, content): if text: text = ANSI_OR_SPECIAL_PATTERN.sub('', text) line = self._control.get_current_line_to_cursor() - name = line[:-1].split('.')[-1] + name = line[:-1].split('(')[-1] # Take last token after a ( + name = name.split('.')[-1] # Then take last token after a . argspec = getargspecfromtext(text) if argspec: # This covers cases like np.abs, whose docstring is