fix #1162
Merge pull request #339 from jygaulier/3.7-fix1162

fix #1162