ternary operator doesn't work in python 2.4