6b24f153d7
All of those patches are picked from upstream. xbps-src check python3-docutils works fine now!
74 lines
3 KiB
Diff
74 lines
3 KiB
Diff
From cfef74f567498f1e097761bc3cae7c0bde2451cc Mon Sep 17 00:00:00 2001
|
|
From: Stephen Finucane <stephen@that.guru>
|
|
Date: Mon, 26 Aug 2019 16:46:50 +0000
|
|
Subject: [PATCH 14/26] py3: Replace 'foo.next()' with 'next(foo)'
|
|
|
|
The former only works in Python 2, while the latter works in Python 2.7
|
|
and 3.x.
|
|
|
|
Signed-off-by: Stephen Finucane <stephen@that.guru>
|
|
|
|
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8361 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
|
|
Signed-off-by: Doan Tran Cong Danh <congdanhqx@gmail.com>
|
|
---
|
|
docutils/utils/code_analyzer.py | 2 +-
|
|
docutils/utils/math/math2html.py | 2 +-
|
|
docutils/writers/manpage.py | 2 +-
|
|
test/test_parsers/test_rst/test_directives/test_tables.py | 2 +-
|
|
4 files changed, 4 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/docutils/utils/code_analyzer.py b/docutils/utils/code_analyzer.py
|
|
index 6dc2e15..87a4584 100644
|
|
--- a/docutils/utils/code_analyzer.py
|
|
+++ b/docutils/utils/code_analyzer.py
|
|
@@ -83,7 +83,7 @@ class Lexer(object):
|
|
Also strip the final newline (added by pygments).
|
|
"""
|
|
tokens = iter(tokens)
|
|
- (lasttype, lastval) = tokens.next()
|
|
+ (lasttype, lastval) = next(tokens)
|
|
for ttype, value in tokens:
|
|
if ttype is lasttype:
|
|
lastval += value
|
|
diff --git a/docutils/utils/math/math2html.py b/docutils/utils/math/math2html.py
|
|
index adcb1cc..ddaca48 100644
|
|
--- a/docutils/utils/math/math2html.py
|
|
+++ b/docutils/utils/math/math2html.py
|
|
@@ -2208,7 +2208,7 @@ class Container(object):
|
|
if ord(pos.current()) > 128:
|
|
codepoint = hex(ord(pos.current()))
|
|
if codepoint == '0xd835':
|
|
- codepoint = hex(ord(pos.next()) + 0xf800)
|
|
+ codepoint = hex(ord(next(pos)) + 0xf800)
|
|
result += '&#' + codepoint[1:] + ';'
|
|
else:
|
|
result += pos.current()
|
|
diff --git a/docutils/writers/manpage.py b/docutils/writers/manpage.py
|
|
index 52cd49c..b39cf25 100644
|
|
--- a/docutils/writers/manpage.py
|
|
+++ b/docutils/writers/manpage.py
|
|
@@ -812,7 +812,7 @@ class Translator(nodes.NodeVisitor):
|
|
def visit_list_item(self, node):
|
|
# man 7 man argues to use ".IP" instead of ".TP"
|
|
self.body.append('.IP %s %d\n' % (
|
|
- self._list_char[-1].next(),
|
|
+ next(self._list_char[-1]),
|
|
self._list_char[-1].get_width(),))
|
|
|
|
def depart_list_item(self, node):
|
|
diff --git a/test/test_parsers/test_rst/test_directives/test_tables.py b/test/test_parsers/test_rst/test_directives/test_tables.py
|
|
index 9d417e8..cc450f3 100755
|
|
--- a/test/test_parsers/test_rst/test_directives/test_tables.py
|
|
+++ b/test/test_parsers/test_rst/test_directives/test_tables.py
|
|
@@ -59,7 +59,7 @@ def null_bytes():
|
|
csv_data = unicode(csv_data, 'latin1').splitlines()
|
|
reader = csv.reader([tables.CSVTable.encode_for_csv(line + '\n')
|
|
for line in csv_data])
|
|
- reader.next()
|
|
+ next(reader)
|
|
|
|
null_bytes_exception = DocutilsTestSupport.exception_data(null_bytes)[0]
|
|
|
|
--
|
|
2.24.0.375.geb5ae68d41
|
|
|