Fix python2.6 compatibility issues (for CentOS).

Change-Id: I8d9a64a85e6b6b7c45b99027058c0d2c0ec6310b