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