summaryrefslogtreecommitdiffstats
path: root/abs/extra/epydoc/handle-docutils-0.6.patch
diff options
context:
space:
mode:
authorBritney Fransen <brfransen@gmail.com>2018-03-04 20:19:26 (GMT)
committerBritney Fransen <brfransen@gmail.com>2018-03-04 20:19:26 (GMT)
commitebcf96d8edab5b9881899b0283a386386c1dc9ef (patch)
tree083c1aa7f0d7f5052e3670e70af84b4e4dc61444 /abs/extra/epydoc/handle-docutils-0.6.patch
parent47242fb978d60a65c0c449aabd6d68c26a37b0d9 (diff)
downloadlinhes_pkgbuild-ebcf96d8edab5b9881899b0283a386386c1dc9ef.zip
linhes_pkgbuild-ebcf96d8edab5b9881899b0283a386386c1dc9ef.tar.gz
linhes_pkgbuild-ebcf96d8edab5b9881899b0283a386386c1dc9ef.tar.bz2
epydoc: dep of python-lxml
Diffstat (limited to 'abs/extra/epydoc/handle-docutils-0.6.patch')
-rw-r--r--abs/extra/epydoc/handle-docutils-0.6.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/abs/extra/epydoc/handle-docutils-0.6.patch b/abs/extra/epydoc/handle-docutils-0.6.patch
new file mode 100644
index 0000000..53f941c
--- /dev/null
+++ b/abs/extra/epydoc/handle-docutils-0.6.patch
@@ -0,0 +1,47 @@
+# Description: Handle problems encountered with docutils 0.6.
+# The problem here is that the child.data element does not always exist any
+# more. Apparently, the child element is sometimes a string instead. So, we
+# work around it by only executing the code in question if child.data can be
+# referenced. Thanks to Thomas Hille for research and the initial patch.
+# Bug-Debian: http://bugs.debian.org/561793
+# Author: Kenneth J. Pronovici <pronovic@debian.org>
+--- a/epydoc/markup/restructuredtext.py
++++ b/epydoc/markup/restructuredtext.py
+@@ -304,13 +304,14 @@ class _SummaryExtractor(NodeVisitor):
+ # Extract the first sentence.
+ for child in node:
+ if isinstance(child, docutils.nodes.Text):
+- m = self._SUMMARY_RE.match(child.data)
+- if m:
+- summary_pieces.append(docutils.nodes.Text(m.group(1)))
+- other = child.data[m.end():]
+- if other and not other.isspace():
+- self.other_docs = True
+- break
++ if hasattr(child, 'data'):
++ m = self._SUMMARY_RE.match(child.data)
++ if m:
++ summary_pieces.append(docutils.nodes.Text(m.group(1)))
++ other = child.data[m.end():]
++ if other and not other.isspace():
++ self.other_docs = True
++ break
+ summary_pieces.append(child)
+
+ summary_doc = self.document.copy() # shallow copy
+@@ -489,10 +490,11 @@ class _SplitFieldsTranslator(NodeVisitor
+ if (len(fbody[0]) > 0 and
+ isinstance(fbody[0][0], docutils.nodes.Text)):
+ child = fbody[0][0]
+- if child.data[:1] in ':-':
+- child.data = child.data[1:].lstrip()
+- elif child.data[:2] in (' -', ' :'):
+- child.data = child.data[2:].lstrip()
++ if hasattr(child, 'data'):
++ if child.data[:1] in ':-':
++ child.data = child.data[1:].lstrip()
++ elif child.data[:2] in (' -', ' :'):
++ child.data = child.data[2:].lstrip()
+
+ # Wrap the field body, and add a new field
+ self._add_field(tagname, arg, fbody)