mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-11 11:25:30 +08:00
fix iteritems for python3 compat
This commit is contained in:
@@ -132,6 +132,14 @@ 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
|
||||
matplotlib.use('Agg')
|
||||
@@ -234,7 +242,7 @@ def mark_plot_labels(app, document):
|
||||
the "htmlonly" (or "latexonly") node to the actual figure node
|
||||
itself.
|
||||
"""
|
||||
for name, explicit in document.nametypes.iteritems():
|
||||
for name, explicit in iteritems(document.nametypes):
|
||||
if not explicit:
|
||||
continue
|
||||
labelid = document.nameids[name]
|
||||
|
||||
Reference in New Issue
Block a user