Ignore:
Timestamp:
Dec 28, 2008, 7:19:55 PM (15 years ago)
Author:
price
Message:

invirt.config: fix an error on empty config files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-base/python/invirt/config.py

    r1926 r1933  
    2121    """Splice dict-tree d2 into d1.  Return d1.
    2222
     23    d2 may be None for an empty dict-tree, because yaml.load produces that.
     24
    2325    Example:
    2426    >>> d = {'a': {'b': 1}, 'c': 2}
     
    2830    {'a': {'b', 1, 'd': 3}, 'c': 2}
    2931    """
     32    if d2 is None:
     33        return d1
    3034    for k in d2:
    3135        if k in d1 and isinstance(d1[k], dict):
Note: See TracChangeset for help on using the changeset viewer.