Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use empty string instead of None for fallback. Fixes #2313. #2316

Merged
merged 1 commit into from
Apr 16, 2015

Conversation

blink1073
Copy link
Contributor

Fixes error in introspection found in #2313, due to CodeInfo using None as the default obj token.

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:
@ccordoba12 ccordoba12 added this to the v3.0 milestone Apr 10, 2015
@ccordoba12
Copy link
Member

Would you mind to fix the description of this PR? ;-)

@blink1073
Copy link
Contributor Author

Whoops, done!

ccordoba12 added a commit that referenced this pull request Apr 16, 2015
Use empty string instead of None for fallback.

Fixes #2313.
@ccordoba12 ccordoba12 merged commit 3bb2e3a into spyder-ide:master Apr 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants