python2.4 compatibility: avoid if/else expression