Update dict iterator compatibility to support Py3+
Changed iterates to support Py3+ using six library
@@ -34,6 +34,7 @@ import sys
from six import StringIO
from six.moves import input
from six.moves.urllib.parse import urlparse, urlunparse
+from six import iteritems
import console
import editor # for reloading current file
@@ -252,7 +253,7 @@ def unstage_all( commit='HEAD'):
for entry in repo.object_store.iter_tree_contents(tree_id):
unstage(commit,[entry.path])
- for entry in index.iteritems():
+ for entry in iteritems(index):
unstage(commit,[entry[0]])
@@ -267,7 +268,7 @@ def git_status(args):
repo = _get_repo()
status = porcelain.status(repo.repo.path)
print('STAGED')
- for k,v in status.staged.iteritems():
+ for k,v in iteritems(status.staged):
if v:
print(k,v)
print('UNSTAGED LOCAL MODS')
@@ -767,7 +768,7 @@ if __name__=='__main__':
ap = argparse.ArgumentParser()
subparser=ap.add_subparsers()
- for key,value in commands.iteritems():
+ for key,value in iteritems(commands):
sp=subparser.add_parser(key, help=command_help[key] ,add_help=False)
sp.set_defaults(func=commands[key])
ns,args=ap.parse_known_args()
