Skip to content

Commit 34acf67

Browse files
committed
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. close pandas-dev#14003
1 parent a0d05db commit 34acf67

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

doc/source/whatsnew/v0.20.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,4 @@ Performance Improvements
8181

8282
Bug Fixes
8383
~~~~~~~~~
84+
Bug when building docs with IPython 5.x (:issue:`14003`)

doc/sphinxext/ipython_sphinxext/ipython_directive.py

+11-5
Original file line numberDiff line numberDiff line change
@@ -799,13 +799,19 @@ def setup(self):
799799
# Store IPython directive to enable better error messages
800800
self.shell.directive = self
801801

802-
# reset the execution count if we haven't processed this doc
803-
#NOTE: this may be borked if there are multiple seen_doc tmp files
804-
#check time stamp?
805-
if not self.state.document.current_source in self.seen_docs:
802+
"""
803+
reset the execution count if we haven't processed this doc
804+
NOTE: this may be borked if there are multiple seen_doc tmp files
805+
check time stamp?
806+
"""
807+
if self.state.document.current_source not in self.seen_docs:
806808
self.shell.IP.history_manager.reset()
807809
self.shell.IP.execution_count = 1
808-
self.shell.IP.prompt_manager.width = 0
810+
try:
811+
self.shell.IP.prompt_manager.width = 0
812+
except AttributeError:
813+
# GH14003: class promptManager has removed after IPython 5.x
814+
pass
809815
self.seen_docs.add(self.state.document.current_source)
810816

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

0 commit comments

Comments
 (0)