[3.12] gh-120590: Fix test_pydoc in the refleak hunting mode (GH-120615) (GH-120670)
Mocking only works if sys.modules['pydoc'] and pydoc are the same, but some pydoc functions reload the module and change sys.modules. Ensure that sys.modules['pydoc'] is always restored after the corresponding tests. (cherry picked from commit 2cf47389e26cb591342d07dad98619916d5a1b15) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
M
Miss Islington (bot) committed
4b53ea822c0c52fa2f0d62728b6573a120f15574
Parent: e4f1fed
Committed by GitHub <noreply@github.com>
on 6/18/2024, 9:44:02 AM