Fix exception on Python 3 when displaying warning about configuration generation

Fixes the original part of #950