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

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

parent 7a337c1c
...@@ -43,6 +43,10 @@ def _cnfmerge(cnfs): ...@@ -43,6 +43,10 @@ def _cnfmerge(cnfs):
else: else:
cnf = {} cnf = {}
for c in _flatten(cnfs): for c in _flatten(cnfs):
try:
cnf.update(c)
except (AttributeError, TypeError), msg:
print "_cnfmerge: fallback due to:", msg
for k, v in c.items(): for k, v in c.items():
cnf[k] = v cnf[k] = v
return cnf return cnf
......
...@@ -43,6 +43,10 @@ def _cnfmerge(cnfs): ...@@ -43,6 +43,10 @@ def _cnfmerge(cnfs):
else: else:
cnf = {} cnf = {}
for c in _flatten(cnfs): for c in _flatten(cnfs):
try:
cnf.update(c)
except (AttributeError, TypeError), msg:
print "_cnfmerge: fallback due to:", msg
for k, v in c.items(): for k, v in c.items():
cnf[k] = v cnf[k] = v
return cnf return cnf
......
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