It would be nice to have ea27fd91 backported to 2.10.
I've included the changes made by @mitch in aeec0f7f to this merge request.