A cleaner way could be to fix the bug in scipy and backport the fixed function in utils (possibly in another PR).