backported safe_eval to python 2.5