python 2.6 compatibility

reformulated import, so that it should succeed on 2.6 as long as the
html backend is not required.