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