The punishment penalties that Islam has prescribed are only carried out by a legitimate Muslim State. If a Muslim commits one of the sins that requires a punishment, it will not be carried out if they do not live in a land where there is a legitimate Muslim khalifah who will carry out such punishments.
Furthermore, if someone commits a sin and it has not reached the legitimate Muslim government officials, it is not a responsibility for Muslims to turn themselves in for punishment.
Therefore, if an unmarried woman is pregnant, she should keep the sin to herself, ask Allah for forgiveness, and there will be no physical punishment for her, unless this news has reached a legitimate Muslim khalifah, or his deputies.
Therefore, there is no need to focus on a hypothetical question since you are most likely not in a situation where any punishment will be enacted. What I have explained is based on the Quran and Sunnah of the Prophet.
Almighty Allah knows best.
Views expressed by hosts/guests on this program (live dialogue, Facebook sessions, etc.) are their own and their appearance on the program does not imply an endorsement of them or any entity they represent.