mirror of
https://github.com/python/cpython.git
synced 2025-09-28 03:13:48 +00:00
Use dictionary's update() method in _cnfmerge().
This commit is contained in:
parent
7a337c1c79
commit
65c78e18b5
2 changed files with 12 additions and 4 deletions
|
@ -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):
|
||||||
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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue