from dateutil import tz


def local_time(dt):
    """
    Convert a datetime.datetime object to a timezone-aware datetime.datetime
    in the users local timezone.

    :param dt: A datetime.datetime object.
    :returns: A timezone-aware datetime.datetime object in the users local
              timezone.
    """
    if dt is None:
        return None
    return dt.replace(tzinfo=tz.tzutc()).astimezone(tz.tzlocal())