two syntax error when python version is 2.6+