When is a personal foul not a team foul in basketball?

When it is an offensive foul.