summaryrefslogtreecommitdiff
path: root/sphinx/ext/autodoc.py
diff options
context:
space:
mode:
authorGunWoo Choi <Hardtack@users.noreply.github.com>2015-11-13 12:52:56 +0900
committerGunWoo Choi <Hardtack@users.noreply.github.com>2015-11-13 12:52:56 +0900
commit22ce010e0a17f60f663b12eac05828bbcaf09c1a (patch)
treedde674f8c0e41cb5800e9ef31f9871617d73c39d /sphinx/ext/autodoc.py
parent132791c8524d8d9aa3aed8892b4bb84e44a3a716 (diff)
downloadsphinx-git-22ce010e0a17f60f663b12eac05828bbcaf09c1a.tar.gz
Make sure to iterate obj_dict's keys using list, not view
In Python3 `dict.keys()` returns a view object not a list
Diffstat (limited to 'sphinx/ext/autodoc.py')
-rw-r--r--sphinx/ext/autodoc.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py
index a6a2a11a3..13621c118 100644
--- a/sphinx/ext/autodoc.py
+++ b/sphinx/ext/autodoc.py
@@ -17,8 +17,8 @@ import inspect
import traceback
from types import FunctionType, BuiltinFunctionType, MethodType
-from six import iteritems, itervalues, text_type, class_types, string_types, \
- StringIO
+from six import iterkeys, iteritems, itervalues, text_type, class_types, \
+ string_types, StringIO
from docutils import nodes
from docutils.utils import assemble_option_dict
from docutils.statemachine import ViewList
@@ -720,7 +720,7 @@ class Documenter(object):
# __dict__ contains only the members directly defined in
# the class (but get them via getattr anyway, to e.g. get
# unbound method objects instead of function objects);
- # using keys() because apparently there are objects for which
+ # using list(iterkeys()) because apparently there are objects for which
# __dict__ changes while getting attributes
try:
obj_dict = self.get_attr(self.object, '__dict__')
@@ -728,7 +728,7 @@ class Documenter(object):
members = []
else:
members = [(mname, self.get_attr(self.object, mname, None))
- for mname in obj_dict.keys()]
+ for mname in list(iterkeys(obj_dict))]
membernames = set(m[0] for m in members)
# add instance attributes from the analyzer
for aname in analyzed_member_names: