Skip to content
Snippets Groups Projects
Commit c77e8820 authored by Manuel Jacob's avatar Manuel Jacob
Browse files

compat: add iteritems and itervalues

Newer versions of Mercurial that properly support Python 3 have them in
pycompat. For older versions of Mercurial we define them, but only for Python 2.
parent bbfad219
No related branches found
No related tags found
1 merge request!14py3 part 2
......@@ -2,6 +2,7 @@
from mercurial import (
context,
pycompat,
templatekw,
ui,
url,
......@@ -29,6 +30,13 @@
quotecommand = hgutil.quotecommand
binary = hgutil.binary
try:
from mercurial.pycompat import iteritems, itervalues
except ImportError:
assert not pycompat.ispy3
iteritems = lambda x: x.iteritems()
itervalues = lambda x: x.itervalues()
def gitvfs(repo):
"""return a vfs suitable to read git related data"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment