|
From: <mi...@us...> - 2019-08-26 16:46:53
|
Revision: 8361
http://sourceforge.net/p/docutils/code/8361
Author: milde
Date: 2019-08-26 16:46:50 +0000 (Mon, 26 Aug 2019)
Log Message:
-----------
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 <st...@th...>
Modified Paths:
--------------
trunk/docutils/docutils/utils/code_analyzer.py
trunk/docutils/docutils/utils/math/math2html.py
trunk/docutils/docutils/writers/manpage.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_tables.py
Modified: trunk/docutils/docutils/utils/code_analyzer.py
===================================================================
--- trunk/docutils/docutils/utils/code_analyzer.py 2019-08-26 16:46:17 UTC (rev 8360)
+++ trunk/docutils/docutils/utils/code_analyzer.py 2019-08-26 16:46:50 UTC (rev 8361)
@@ -83,7 +83,7 @@
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
Modified: trunk/docutils/docutils/utils/math/math2html.py
===================================================================
--- trunk/docutils/docutils/utils/math/math2html.py 2019-08-26 16:46:17 UTC (rev 8360)
+++ trunk/docutils/docutils/utils/math/math2html.py 2019-08-26 16:46:50 UTC (rev 8361)
@@ -2208,7 +2208,7 @@
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()
Modified: trunk/docutils/docutils/writers/manpage.py
===================================================================
--- trunk/docutils/docutils/writers/manpage.py 2019-08-26 16:46:17 UTC (rev 8360)
+++ trunk/docutils/docutils/writers/manpage.py 2019-08-26 16:46:50 UTC (rev 8361)
@@ -812,7 +812,7 @@
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):
Modified: trunk/docutils/test/test_parsers/test_rst/test_directives/test_tables.py
===================================================================
--- trunk/docutils/test/test_parsers/test_rst/test_directives/test_tables.py 2019-08-26 16:46:17 UTC (rev 8360)
+++ trunk/docutils/test/test_parsers/test_rst/test_directives/test_tables.py 2019-08-26 16:46:50 UTC (rev 8361)
@@ -59,7 +59,7 @@
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]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|