(msg)
Replacement for `warnings._showwarnmsg_impl` that logs the warning
    Logs the warning in the appropriate list, or passes it to the original
    function if the warning wasn't issued within the log_warnings context.
Replacement for `warnings._showwarnmsg_impl` that logs the warning
    Logs the warning in the appropriate list, or passes it to the original
    function if the warning wasn't issued within the log_warnings context.
Replacement for warnings . _showwarnmsg_impl that logs the warning Logs the warning in the appropriate list or passes it to the original function if the warning wasn t issued within the log_warnings context .
def _log_warning(msg):
    """
    Replacement for `warnings._showwarnmsg_impl` that logs the warning
    Logs the warning in the appropriate list, or passes it to the original
    function if the warning wasn't issued within the log_warnings context.
    """
    for frame in inspect.stack():
        if frame.frame in warning_loggers:
            warning_loggers[frame.frame].append(msg)
            break
    else:
        __orig_showwarnmsg_impl(msg)
def _log_warning ( msg ) : for frame in inspect . stack ( ) : if frame . frame in warning_loggers : warning_loggers [ frame . frame ] . append ( msg ) break else : __orig_showwarnmsg_impl ( msg )