Make solr4 templates compatible with python versions <3.