Kaydet (Commit) 65c78e18 authored tarafından Guido van Rossum's avatar Guido van Rossum

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

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