This short MR should fix the errors seen in the python3 nightly build failures, for example here. Should be ready for testing.
FYI @dzuliani