Make python client compatible with python 2.6+ (including Python 3.x)