This happened before the prescribed punishments(hudud) were revealed, meaning the tradition of Anas. Sunan Abi Dawud Book 40, Hadith 21