When a sentence of imprisonment is to be served on a woman who is more than twelve weeks pregnant, the public prosecutor or the sentence enforcement judge shall make every effort either to defer the sentence or to ensure that it is served in an open environment.