Skip to content

Commit

Permalink
Use empty string instead of None for fallback. Fixes #2313.
Browse files Browse the repository at this point in the history
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:
  • Loading branch information
blink1073 committed Apr 10, 2015
1 parent 742d142 commit c4e5196
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions spyderlib/utils/introspection/plugin_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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()

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit c4e5196

Please sign in to comment.