"gem"-module: replace python 2.5 language feature

replace conditional expression with python 2.4-compatible if/else
statements