From 345ba0d3c245b21b3262196cc5200dfc800a72b6 Mon Sep 17 00:00:00 2001 From: David Halter Date: Mon, 26 Aug 2013 20:21:03 +0430 Subject: [PATCH] docstrings of builtins can be non-standard, fixes #298 --- jedi/builtin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jedi/builtin.py b/jedi/builtin.py index e75ee6b5..6c4c398f 100644 --- a/jedi/builtin.py +++ b/jedi/builtin.py @@ -374,7 +374,7 @@ def _parse_function_doc(func): change_options, param_str) if changes == 0: break - except (ValueError, AttributeError): + except (ValueError, AttributeError, UnboundLocalError): debug.dbg('no brackets found - no param') end = 0 param_str = '' @@ -384,7 +384,7 @@ def _parse_function_doc(func): if doc is not None: r = re.search('-[>-]* ', doc[end:end + 7]) if doc is None or r is None: - ret = 'pass' + ret = 'pass' if doc is None else '' else: index = end + r.end() # get result type, which can contain newlines