Fix compliation for python bindings
Patch effectively written by David Faure on the bug report
BUG: 407306