mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-26 13:37:17 +08:00
use items/values for python2/3 compat
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user