Commit 65c78e18 authored by Guido van Rossum's avatar Guido van Rossum

Use dictionary's update() method in _cnfmerge().

parent 7a337c1c
......@@ -43,8 +43,12 @@ def _cnfmerge(cnfs):
else:
cnf = {}
for c in _flatten(cnfs):
for k, v in c.items():
cnf[k] = v
try:
cnf.update(c)
except (AttributeError, TypeError), msg:
print "_cnfmerge: fallback due to:", msg
for k, v in c.items():
cnf[k] = v
return cnf
class Event:
......
......@@ -43,8 +43,12 @@ def _cnfmerge(cnfs):
else:
cnf = {}
for c in _flatten(cnfs):
for k, v in c.items():
cnf[k] = v
try:
cnf.update(c)
except (AttributeError, TypeError), msg:
print "_cnfmerge: fallback due to:", msg
for k, v in c.items():
cnf[k] = v
return cnf
class Event:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment