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

This commit is contained in:
Guido van Rossum 1997-07-19 20:02:04 +00:00
parent 7a337c1c79
commit 65c78e18b5
2 changed files with 12 additions and 4 deletions

View File

@ -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:

View File

@ -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: