Al-Hasan (may Allah have mercy on him) and Muhammad (may Allah have mercy on him) said that he may divorce a pregnant woman whenever he wishes.