Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d04f7d7

Browse files
committed
clear docstring when there isn't one
1 parent 0192931 commit d04f7d7

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

bipython/__init__.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ def _get_args(self):
853853

854854
def complete(self, tab=False):
855855
"bipython completion - punt to ipython"
856-
self.docstring = None
856+
self.docstring = ''
857857

858858
returned = self.ipython_process_msgs()
859859

@@ -1098,12 +1098,11 @@ def _populate_completion(self):
10981098
self.tooltip.grid = None
10991099
self.docstring_widget = urwid.Text(('comment', ''))
11001100
widget_list.append(self.docstring_widget)
1101-
self._populate_docstring(pop=False)
1101+
self._populate_docstring()
11021102

1103-
def _populate_docstring(self, pop=False):
1103+
def _populate_docstring(self):
11041104
"Make visible the docstring"
1105-
if self.docstring:
1106-
self.docstring_widget.set_text(('comment', self.docstring))
1105+
self.docstring_widget.set_text(('comment', self.docstring))
11071106

11081107
def reprint_line(self, lineno, tokens):
11091108
edit = self.edits[-len(self.buffer) + lineno - 1]
@@ -1296,7 +1295,6 @@ def ipython_get_doc(self, func):
12961295
#self.debug_docstring = 'doc called for ' + func
12971296
#self.stdout_hist += "\nDEBUG: doc called for " + func
12981297
#self.send_ipython('# ' + self.debug_docstring)
1299-
pop = self.docstring is not None
13001298
try:
13011299
level = 0
13021300
msg_id = self.kc.shell_channel.object_info(func, level)
@@ -1305,11 +1303,8 @@ def ipython_get_doc(self, func):
13051303
doc = ['']
13061304
self.docstring = "\n".join(doc)
13071305
except IndexError:
1308-
self.docstring = None
1309-
else:
1310-
if not self.docstring:
1311-
self.docstring = None
1312-
self._populate_docstring( pop=pop)
1306+
self.docstring = ''
1307+
self._populate_docstring()
13131308

13141309
def ipython_get_doc_msg(self, msg_id):
13151310
n = 13 # longest field name (empirically)

0 commit comments

Comments
 (0)