def to_ip ( value ) :
    :
        value = str ( dns . resolver . query ( value , "str" [ 0 ] )
    except dns . resolver . NXDOMAIN :
        value = None
    return value

def to_ip ( value ) :
    try :
        value = str ( dns . resolver . query ( value , "str" ) [ 0 ] )
    except dns . resolver . NXDOMAIN :
        value = None
    return value

次に示すpythonコードの誤りを修正しなさい。