Skip to content

fix ipython directive, py3 and recent ipython changes #6250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
2 commits merged into from Feb 4, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import sys
import os
import re
from pandas.compat import u
from pandas.compat import u, PY3

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -78,7 +78,10 @@
if ds:
print("I'm about to DELETE the following:\n%s\n" % list(sorted(ds)))
sys.stdout.write("WARNING: I'd like to delete those to speed up processing (yes/no)? ")
answer = raw_input()
if PY3:
answer = input()
else:
answer = raw_input()

if answer.lower().strip() in ('y','yes'):
for f in ds:
Expand Down
6 changes: 5 additions & 1 deletion doc/sphinxext/ipython_directive.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,11 @@ def process_input_line(self, line, store_history=True):
splitter.push(line)
more = splitter.push_accepts_more()
if not more:
source_raw = splitter.source_raw_reset()[1]
try:
source_raw = splitter.source_raw_reset()[1]
except:
# recent ipython #4504
source_raw = splitter.raw_reset()
self.IP.run_cell(source_raw, store_history=store_history)
finally:
sys.stdout = stdout
Expand Down