Function load_warning

Synopsis

def load_warning(method)

Description

No description yet.

Source

Lines 43-57 in lib3/yaml/__init__.py.

def load_warning(method):
    if _warnings_enabled['YAMLLoadWarning'] is False:
        return

    import warnings

    message = (
        "calling yaml.%s() without Loader=... is deprecated, as the "
        "default Loader is unsafe. Please read "
        "https://msg.pyyaml.org/load for full details."
    ) % method

    warnings.warn(message, YAMLLoadWarning, stacklevel=3)

#------------------------------------------------------------------------------





Add Discussion as Guest

Log in