supporting python 2.6/2.7