Make code Python2.4 compatible

Change-Id: Ic7bee1bd1a8055c80149af8c8380dc06e90a6a7d