Skip to content

Commit 6d8044c

Browse files
znmeanjorisvandenbossche
authored andcommitted
DOC: fixed using IP.prompt_manager which is removed from IPython 5.x (#14004)
* fixed using IP.prompt_manager which is removed from IPython 5.x class promptManager has removed in IPython 5.x, but this file still using that class, so it makes AttributeError.
1 parent 1919e26 commit 6d8044c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

doc/sphinxext/ipython_sphinxext/ipython_directive.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -802,10 +802,14 @@ def setup(self):
802802
# reset the execution count if we haven't processed this doc
803803
#NOTE: this may be borked if there are multiple seen_doc tmp files
804804
#check time stamp?
805-
if not self.state.document.current_source in self.seen_docs:
805+
if self.state.document.current_source not in self.seen_docs:
806806
self.shell.IP.history_manager.reset()
807807
self.shell.IP.execution_count = 1
808-
self.shell.IP.prompt_manager.width = 0
808+
try:
809+
self.shell.IP.prompt_manager.width = 0
810+
except AttributeError:
811+
# GH14003: class promptManager has removed after IPython 5.x
812+
pass
809813
self.seen_docs.add(self.state.document.current_source)
810814

811815
# and attach to shell so we don't have to pass them around

0 commit comments

Comments
 (0)