This PR polishes the changes made in gh-29883 a bit.
Comment From: bclozel
Thanks @izeye ! Closed with 433b72d493579