change to support python<2.7
Merge branch 'master' into dev