def purge(self):
        """
        Purges read/write buffers.
        """
        try:
            self._device.setblocking(0)
            while(self._device.recv(1)):
                pass
        except socket.error as err:
            pass
        finally:
            self._device.setblocking(1)
def purge ( self ) : try : self . _device . setblocking ( 0 ) while ( self . _device . recv ( 1 ) ) : pass except socket . error as err : pass finally : self . _device . setblocking ( 1 )
Purges read/write buffers.