from datetime import datetime


def tz_str_to_tzinfo(tz: str):
    """
    Convert a timezone string (e.g. -0400) to a tzinfo
    If "local", return None
    """
    if tz == "local":
        return None
    try:
        return datetime.strptime(tz, "%z").tzinfo
    except ValueError:
        pass