bpo-24746: Fix doctest failures when running the testsuite with -R (GH-11501)

(cherry picked from commit c5dc60ea858b8ccf78e8d26db81c307a8f9b2314)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
1 file changed