Fix a bit of logic surrounding Python 3/Genshi 0.7