Fix regression with warnings that contained non-strings in their arguments in Python 2.