[Python-checkins] bpo-34182: Fix test_pydoc running as a script. (GH-8389)