The ignore_warnings decorator I introduce in #2334 would be better applied here, but I don't really have the time to fix up either PR atm.