mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Use next() function instead of iter.next().
This commit is contained in:
parent
87bbe8ddd5
commit
434da2a4fb
@ -18,6 +18,7 @@ from sphinx.errors import PycodeError
|
||||
from sphinx.pycode import nodes
|
||||
from sphinx.pycode.pgen2 import driver, token, tokenize, parse, literals
|
||||
from sphinx.util import get_module_source
|
||||
from sphinx.util.pycompat import next
|
||||
from sphinx.util.docstrings import prepare_docstring, prepare_commentdoc
|
||||
|
||||
|
||||
@ -279,7 +280,7 @@ class ModuleAnalyzer(object):
|
||||
result[fullname] = (dtype, startline, endline)
|
||||
expect_indent = False
|
||||
if tok in ('def', 'class'):
|
||||
name = tokeniter.next()[1]
|
||||
name = next(tokeniter)[1]
|
||||
namespace.append(name)
|
||||
fullname = '.'.join(namespace)
|
||||
stack.append((tok, fullname, spos[0], indent))
|
||||
|
@ -34,6 +34,14 @@ else:
|
||||
b = str
|
||||
|
||||
|
||||
try:
|
||||
next
|
||||
except NameError:
|
||||
# this is on Python 2, where the method is called "next"
|
||||
def next(iterator):
|
||||
return iterator.next()
|
||||
|
||||
|
||||
try:
|
||||
any = any
|
||||
all = all
|
||||
|
Loading…
Reference in New Issue
Block a user