PR for  #1992 in 3.x

Slightly different because 3.x has had a refactoring that 3.3 didn't see.

#1992