Skip to content

Commit 0773161

Browse files
author
y-p
committed
BLD/DOC: fix ipython_directive to workaround ipython/4504
1 parent a278b14 commit 0773161

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

doc/sphinxext/ipython_directive.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,11 @@ def process_input_line(self, line, store_history=True):
344344
splitter.push(line)
345345
more = splitter.push_accepts_more()
346346
if not more:
347-
source_raw = splitter.source_raw_reset()[1]
347+
try:
348+
source_raw = splitter.source_raw_reset()[1]
349+
except:
350+
# recent ipython #4504
351+
source_raw = splitter.raw_reset()
348352
self.IP.run_cell(source_raw, store_history=store_history)
349353
finally:
350354
sys.stdout = stdout

0 commit comments

Comments
 (0)