def set_warn(reg, warn):
    """ Groups warning messages for printout. """
    if warn:
        try:
            reg.warning += 'Warning: ' + warn + '\n'
        except:
            reg.warning = 'Warning: ' + warn + '\n'
    else:
        pass
