The previous logic was only needed for pre-release versions of 3.7. (cherry picked from commit c0bf9815c9)
c0bf9815c9