From 4953576266ec402ed6d7d59119468dfb6d66d8af Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 7 Jan 2015 05:46:11 +0000 Subject: [PATCH] Py3 compatability --- salt/utils/dictupdate.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/salt/utils/dictupdate.py b/salt/utils/dictupdate.py index 200455b779..7647c227e1 100644 --- a/salt/utils/dictupdate.py +++ b/salt/utils/dictupdate.py @@ -3,10 +3,12 @@ Alex Martelli's soulution for recursive dict update from http://stackoverflow.com/a/3233356 ''' -from __future__ import absolute_import # Import python libs +from __future__ import absolute_import import collections + +# Import 3rd-party libs import salt.ext.six as six @@ -22,9 +24,9 @@ def update(dest, upd): def merge(d1, d2): md = {} - for k, v in d1.iteritems(): - if k in d2: - md[k] = [v, d2[k]] + for key, val in six.iteritems(d1): + if key in d2: + md[key] = [val, d2[key]] else: - md[k] = v + md[key] = val return md