use items/values for python2/3 compat

This commit is contained in:
François Boulogne
2013-06-20 11:16:23 +02:00
parent cc249baa6c
commit 3926f1873d
7 changed files with 7 additions and 60 deletions
+1 -8
View File
@@ -132,13 +132,6 @@ except ImportError:
def format_template(template, **kw):
return jinja.from_string(template, **kw)
# Python2/3 compatibility
import sys
PY2 = sys.version_info[0] == 2
if PY2:
iteritems = lambda d: d.iteritems()
else:
iteritems = lambda d: d.items()
import matplotlib
import matplotlib.cbook as cbook
@@ -242,7 +235,7 @@ def mark_plot_labels(app, document):
the "htmlonly" (or "latexonly") node to the actual figure node
itself.
"""
for name, explicit in iteritems(document.nametypes):
for name, explicit in document.nametypes.items():
if not explicit:
continue
labelid = document.nameids[name]