def close(self):
        """Close the spidev SPI device.

        Raises:
            SPIError: if an I/O or OS error occurs.

        """
        if self._fd is None:
            return

        try:
            os.close(self._fd)
        except __HOLE__ as e:
            raise SPIError(e.errno, "Closing SPI device: " + e.strerror)

        self._fd = None

    # Immutable properties
dataset/ETHPy150Open vsergeev/python-periphery/periphery/spi.py/SPI.close