Make combine_vars() compatible with Python 3

Fixes

  TypeError: unsupported operand type(s) for +: 'dict_items' and 'dict_items'

on Python 3.
This commit is contained in:
Marius Gedminas 2015-09-01 09:39:59 +03:00
commit 54dbfba8f8
2 changed files with 6 additions and 2 deletions

View file

@ -32,7 +32,9 @@ def combine_vars(a, b):
if C.DEFAULT_HASH_BEHAVIOUR == "merge":
return merge_hash(a, b)
else:
return dict(a.items() + b.items())
result = a.copy()
result.update(b)
return result
def merge_hash(a, b):
''' recursively merges hash b into a