Issue #23016: A warning no longer produces an AttributeError when the program
is run with pythonw.exe.