summaryrefslogtreecommitdiff
path: root/sphinx/ext/autosummary/generate.py
diff options
context:
space:
mode:
authorDmitry Shachnev <mitya57@gmail.com>2014-01-22 18:34:51 +0400
committerDmitry Shachnev <mitya57@gmail.com>2014-01-22 18:34:51 +0400
commit953b33d3f721e58ab48490d33c141df1e4dd25c1 (patch)
tree26bce4c2ef75b4ebe8422685d8962aa07978bad2 /sphinx/ext/autosummary/generate.py
parent317930a7fbd49b50fb8a144161a698fcafeab91a (diff)
parent5f13479408785818ee8b85d4172314ea5578fde3 (diff)
downloadsphinx-git-953b33d3f721e58ab48490d33c141df1e4dd25c1.tar.gz
Merge
Diffstat (limited to 'sphinx/ext/autosummary/generate.py')
-rw-r--r--sphinx/ext/autosummary/generate.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/sphinx/ext/autosummary/generate.py b/sphinx/ext/autosummary/generate.py
index f45aa0858..605521c2b 100644
--- a/sphinx/ext/autosummary/generate.py
+++ b/sphinx/ext/autosummary/generate.py
@@ -17,6 +17,7 @@
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
+from __future__ import print_function
import os
import re
@@ -70,10 +71,10 @@ def main(argv=sys.argv):
template_dir=options.templates)
def _simple_info(msg):
- print msg
+ print(msg)
def _simple_warn(msg):
- print >> sys.stderr, 'WARNING: ' + msg
+ print('WARNING: ' + msg, file=sys.stderr)
# -- Generating output ---------------------------------------------------------
@@ -127,7 +128,7 @@ def generate_autosummary_docs(sources, output_dir=None, suffix='.rst',
try:
name, obj, parent = import_by_name(name)
- except ImportError, e:
+ except ImportError as e:
warn('[autosummary] failed to import %r: %s' % (name, e))
continue
@@ -240,8 +241,8 @@ def find_autosummary_in_docstring(name, module=None, filename=None):
return find_autosummary_in_lines(lines, module=name, filename=filename)
except AttributeError:
pass
- except ImportError, e:
- print "Failed to import '%s': %s" % (name, e)
+ except ImportError as e:
+ print("Failed to import '%s': %s" % (name, e))
return []
def find_autosummary_in_lines(lines, module=None, filename=None):