def dict_override(a, b):
    """Overriding dictionary values.

    Values in second dictionary override the values in the first one (except
    when relevant value in second dictionary is None).

    >>> dict_override({'a': 1,'b': 2}, {'a': 3,'b': None}) == {'a': 3,'b': 2}
    True

    >>> dict_override({'a': 3,'b': None}, {'a': 1,'b': 2}) == {'a': 1,'b': 2}
    True

    >>> dict_override({'a': 6,'b': None}, {'b': 7}) == {'a': 6,'b': 7}
    True
    """
    res = {}
    for key in (set(a.keys()) | set(b.keys())):
        if key in b and b[key] != None:
            res[key] = b[key]
        else:
            res[key] = a[key]
    return res
