She didn't get pregnant. Hephaestus almost raped her, but she avoided him. When she cleaned her thighs from his body fluids, she threw them on the earth, and Erechtheus was born.