Enacted in 2007 by military ruler Gen. Pervez Musharraf , the amnesty law was aimed at allowing Zardari and Bhutto to return from exile to Pakistan without facing the prospect of any politically motivated prosecution .