diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2013-04-06 07:42:08 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-04-06 07:42:08 -0700 |
commit | 49a8902a673d6fb2ba9ca446fc652aa9d2e55e1b (patch) | |
tree | e71c0d8f6123307860a58796ed840bf32526b3fe /doc | |
parent | 3c8fc14665548c71a9cd144b2e16d9309a92e255 (diff) | |
parent | 4394515cd5632a7f110993ff75033d407d10861d (diff) | |
download | numpy-49a8902a673d6fb2ba9ca446fc652aa9d2e55e1b.tar.gz |
Merge pull request #3191 from charris/2to3-apply-imports-fixer
2to3: Apply `imports` fixer.
Diffstat (limited to 'doc')
-rwxr-xr-x | doc/cdoc/numpyfilter.py | 8 | ||||
-rw-r--r-- | doc/numpybook/runcode.py | 6 | ||||
-rw-r--r-- | doc/sphinxext/numpydoc/comment_eater.py | 2 | ||||
-rw-r--r-- | doc/sphinxext/numpydoc/compiler_unparse.py | 2 | ||||
-rw-r--r-- | doc/sphinxext/numpydoc/docscrape.py | 2 | ||||
-rw-r--r-- | doc/sphinxext/numpydoc/plot_directive.py | 2 |
6 files changed, 13 insertions, 9 deletions
diff --git a/doc/cdoc/numpyfilter.py b/doc/cdoc/numpyfilter.py index 60bee1b51..d5021f92a 100755 --- a/doc/cdoc/numpyfilter.py +++ b/doc/cdoc/numpyfilter.py @@ -13,7 +13,11 @@ import re import os import textwrap import optparse -import cPickle as pickle + +if sys.version_info[0] >= 3: + import pickle +else: + import cPickle as pickle CACHE_FILE = 'build/rst-cache.pck' @@ -43,7 +47,7 @@ def filter_comment(text): if text.startswith('UFUNC_API'): text = text[9:].strip() - html = render_html(text) + html = render_html(text) return html def process_match(m, cache=None): diff --git a/doc/numpybook/runcode.py b/doc/numpybook/runcode.py index 66c74cd74..858168e11 100644 --- a/doc/numpybook/runcode.py +++ b/doc/numpybook/runcode.py @@ -18,7 +18,7 @@ from __future__ import division, absolute_import import sys import optparse -import cStringIO +import io import re import os @@ -27,7 +27,7 @@ newre = re.compile(r"\\begin_inset Note.*PYNEW\s+\\end_inset", re.DOTALL) def getoutput(tstr, dic): print "\n\nRunning..." print tstr, - tempstr = cStringIO.StringIO() + tempstr = io.StringIO() sys.stdout = tempstr code = compile(tstr, '<input>', 'exec') try: @@ -82,7 +82,7 @@ def getnewcodestr(substr, dic): def runpycode(lyxstr, name='MyCode'): schobj = re.compile(r"\\layout %s\s+>>> " % name) - outstr = cStringIO.StringIO() + outstr = io.StringIO() num = 0 indx = [] for it in schobj.finditer(lyxstr): diff --git a/doc/sphinxext/numpydoc/comment_eater.py b/doc/sphinxext/numpydoc/comment_eater.py index 74d0d4768..2c7f4da31 100644 --- a/doc/sphinxext/numpydoc/comment_eater.py +++ b/doc/sphinxext/numpydoc/comment_eater.py @@ -4,7 +4,7 @@ import sys if sys.version_info[0] >= 3: from io import StringIO else: - from cStringIO import StringIO + from io import StringIO import compiler import inspect diff --git a/doc/sphinxext/numpydoc/compiler_unparse.py b/doc/sphinxext/numpydoc/compiler_unparse.py index bb76f7ea3..c36389d13 100644 --- a/doc/sphinxext/numpydoc/compiler_unparse.py +++ b/doc/sphinxext/numpydoc/compiler_unparse.py @@ -18,7 +18,7 @@ from compiler.ast import Const, Name, Tuple, Div, Mul, Sub, Add if sys.version_info[0] >= 3: from io import StringIO else: - from cStringIO import StringIO + from io import StringIO def unparse(ast, single_line_functions=False): s = StringIO() diff --git a/doc/sphinxext/numpydoc/docscrape.py b/doc/sphinxext/numpydoc/docscrape.py index af76b86e5..59d3f9734 100644 --- a/doc/sphinxext/numpydoc/docscrape.py +++ b/doc/sphinxext/numpydoc/docscrape.py @@ -14,7 +14,7 @@ import collections if sys.version_info[0] >= 3: from io import StringIO else: - from cStringIO import StringIO + from io import StringIO class Reader(object): """A line-based string reader. diff --git a/doc/sphinxext/numpydoc/plot_directive.py b/doc/sphinxext/numpydoc/plot_directive.py index 9e92acabb..a7f4655ce 100644 --- a/doc/sphinxext/numpydoc/plot_directive.py +++ b/doc/sphinxext/numpydoc/plot_directive.py @@ -82,7 +82,7 @@ import sphinx if sys.version_info[0] >= 3: from io import StringIO else: - from cStringIO import StringIO + from io import StringIO import warnings warnings.warn("A plot_directive module is also available under " |