[gnome-builder/gnome-builder-3-18] jedi: fix exception in docstring parsing
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-3-18] jedi: fix exception in docstring parsing
- Date: Tue, 13 Oct 2015 07:33:21 +0000 (UTC)
commit 222896b19cfadf2435bee2aa2f94c1d7040faaf1
Author: Christian Hergert <christian hergert me>
Date: Fri Oct 2 14:08:52 2015 -0700
jedi: fix exception in docstring parsing
plugins/jedi/jedi_plugin.py | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/plugins/jedi/jedi_plugin.py b/plugins/jedi/jedi_plugin.py
index 29430db..c3056ce 100644
--- a/plugins/jedi/jedi_plugin.py
+++ b/plugins/jedi/jedi_plugin.py
@@ -54,8 +54,10 @@ try:
def py__call__(self):
def actual(evaluator, params):
# Pasrse the docstring to find the return type:
- ret_type = self.obj.__doc__.split('->')[1].strip()
- ret_type = ret_type.replace(' or None', '')
+ ret_type = ''
+ if '->' in self.obj.__doc__:
+ ret_type = self.obj.__doc__.split('->')[1].strip()
+ ret_type = ret_type.replace(' or None', '')
if ret_type.startswith('iter:'):
ret_type = ret_type[len('iter:'):] # we don't care if it's an iterator
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]