import datetime


def expiration_str_to_datetime(exp_str):
    """Returns datetime object from expiration date string.
    Expected input is string formatted as month/day or month/day/year(2 or 4 digits)"""

    split_exp = exp_str.split("/")
    if len(split_exp) == 2:
        month_str, day_str = split_exp
        # assume expiration without year has expiration of current year
        year = datetime.datetime.today().year
        return datetime.datetime(year, int(month_str), int(day_str))
    elif len(split_exp) == 3:
        month_str, day_str, yr_str = split_exp
        if len(yr_str) == 2:
            yr_str = "20" + yr_str
        return datetime.datetime(int(yr_str), int(month_str), int(day_str))