diff options
author | Dmitry Shachnev <mitya57@gmail.com> | 2014-01-22 18:34:51 +0400 |
---|---|---|
committer | Dmitry Shachnev <mitya57@gmail.com> | 2014-01-22 18:34:51 +0400 |
commit | 953b33d3f721e58ab48490d33c141df1e4dd25c1 (patch) | |
tree | 26bce4c2ef75b4ebe8422685d8962aa07978bad2 /sphinx/environment.py | |
parent | 317930a7fbd49b50fb8a144161a698fcafeab91a (diff) | |
parent | 5f13479408785818ee8b85d4172314ea5578fde3 (diff) | |
download | sphinx-git-953b33d3f721e58ab48490d33c141df1e4dd25c1.tar.gz |
Merge
Diffstat (limited to 'sphinx/environment.py')
-rw-r--r-- | sphinx/environment.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sphinx/environment.py b/sphinx/environment.py index ca9a213e4..ce6b23293 100644 --- a/sphinx/environment.py +++ b/sphinx/environment.py @@ -618,8 +618,16 @@ class BuildEnvironment: pub.process_programmatic_settings(None, self.settings, None) pub.set_source(None, src_path.encode(fs_encoding)) pub.set_destination(None, None) +<<<<<<< local pub.publish() doctree = pub.document +======= + try: + pub.publish() + doctree = pub.document + except UnicodeError as err: + raise SphinxError(str(err)) +>>>>>>> other # post-processing self.filter_messages(doctree) @@ -808,7 +816,7 @@ class BuildEnvironment: imgtype = imghdr.what(f) finally: f.close() - except (OSError, IOError), err: + except (OSError, IOError) as err: self.warn_node('image file %s not readable: %s' % (filename, err), node) if imgtype: @@ -919,7 +927,7 @@ class BuildEnvironment: longtitlenode = titlenode # explicit title set with title directive; use this only for # the <title> tag in HTML output - if document.has_key('title'): + if 'title' in document: longtitlenode = nodes.title() longtitlenode += nodes.Text(document['title']) # look for first section title and use that as the title @@ -1423,7 +1431,7 @@ class BuildEnvironment: for node in doctree.traverse(addnodes.only): try: ret = builder.tags.eval_condition(node['expr']) - except Exception, err: + except Exception as err: self.warn_node('exception while evaluating only ' 'directive expression: %s' % err, node) node.replace_self(node.children or nodes.comment()) @@ -1549,7 +1557,7 @@ class BuildEnvironment: add_entry(first, _('see also %s') % second, link=False) else: self.warn(fn, 'unknown index entry type %r' % type) - except ValueError, err: + except ValueError as err: self.warn(fn, str(err)) # sort the index entries; put all symbols at the front, even those |