def _get_databits(self):
        # Get tty attributes
        try:
            (_, _, cflag, _, _, _, _) = termios.tcgetattr(self._fd)
        except termios.error as e:
            raise SerialError(e.errno, "Getting serial port attributes: " + e.strerror)

        cs = cflag & termios.CSIZE

        if cs not in Serial._CFLAG_TO_DATABITS:
            raise SerialError(None, "Unknown data bits setting: csize 0x%x." % cs)

        return Serial._CFLAG_TO_DATABITS[cs]
dataset/ETHPy150Open vsergeev/python-periphery/periphery/serial.py/Serial._get_databits/original