change tpl conversion script to support Python 2.4