adapted to recent SPI-Py