diff --git a/doc/source/conf.py b/doc/source/conf.py index 642a4438f4a3b..ee007e3489e3a 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -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 @@ -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: diff --git a/doc/sphinxext/ipython_directive.py b/doc/sphinxext/ipython_directive.py index ff2379eb7b9eb..3f9be95609874 100644 --- a/doc/sphinxext/ipython_directive.py +++ b/doc/sphinxext/ipython_directive.py @@ -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