Revert "Merge pull request #2052 from antoinepairet/3.8.x"

This reverts commit 2dc92cb1b025cbe6a6537fb0f70ef69f2cdedf03, reversing
changes made to 94cc9c788763a6fd5afaa0c07dbfae8d6d86cf07.