This doesn't do what I think you think it does. `str(None)` yields `'None'`. The only case where `str(msg)` would return something that's falsey is if `msg` was the empty string. In all other cases, it either returns something truthy or kicks up an exception.

It's not worth fixing in this pull request, but is probably worth fixing in a future one.