From c4e51963a252804184e25cf8cfa3e5e6575599ec Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 10 Apr 2015 13:12:52 -0500 Subject: [PATCH] Use empty string instead of None for fallback. Fixes #2313. diff --git a/spyderlib/utils/introspection/plugin_manager.py b/spyderlib/utils/introspection/plugin_manager.py index 9685848..0db27dd 100644 --- a/spyderlib/utils/introspection/plugin_manager.py +++ b/spyderlib/utils/introspection/plugin_manager.py @@ -158,7 +158,7 @@ class CodeInfo(object): break position -= 1 else: - self.docstring = None + self.docstring = '' self.position = position @@ -167,8 +167,8 @@ class CodeInfo(object): self.column = 0 self.line_num = 0 self.line = '' - self.obj = None - self.full_obj = None + self.obj = '' + self.full_obj = '' else: self._get_info() @@ -229,6 +229,7 @@ class CodeInfo(object): right += 1 if left and right < len(self.source_code): return self.source_code[left: right] + return '' def __eq__(self, other): try: --- spyderlib/utils/introspection/plugin_manager.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spyderlib/utils/introspection/plugin_manager.py b/spyderlib/utils/introspection/plugin_manager.py index 9685848429c..0db27ddf33f 100644 --- a/spyderlib/utils/introspection/plugin_manager.py +++ b/spyderlib/utils/introspection/plugin_manager.py @@ -158,7 +158,7 @@ def __init__(self, name, source_code, position, filename=None, break position -= 1 else: - self.docstring = None + self.docstring = '' self.position = position @@ -167,8 +167,8 @@ def __init__(self, name, source_code, position, filename=None, self.column = 0 self.line_num = 0 self.line = '' - self.obj = None - self.full_obj = None + self.obj = '' + self.full_obj = '' else: self._get_info() @@ -229,6 +229,7 @@ def _get_docstring(self): right += 1 if left and right < len(self.source_code): return self.source_code[left: right] + return '' def __eq__(self, other): try: