parameters: (self, baudrate)
docstring: Change baud rate. It raises a ValueError if the port is open and the
          baud rate is not possible. If the port is closed, then the value is
          accepted and the exception is raised when the port is opened.
docstring_summary: Change baud rate. It raises a ValueError if the port is open and the
          baud rate is not possible. If the port is closed, then the value is
          accepted and the exception is raised when the port is opened.
docstring_tokens: Change baud rate . It raises a ValueError if the port is open and the baud rate is not possible . If the port is closed then the value is accepted and the exception is raised when the port is opened .
function: def setBaudrate(self, baudrate):
          """Change baud rate. It raises a ValueError if the port is open and the
          baud rate is not possible. If the port is closed, then the value is
          accepted and the exception is raised when the port is opened."""
          try:
              b = int(baudrate)
          except TypeError:
              raise ValueError("Not a valid baudrate: %r" % (baudrate,))
          else:
              if b <= 0:
                  raise ValueError("Not a valid baudrate: %r" % (baudrate,))
              self._baudrate = b
              if self._isOpen:  self._reconfigurePort()
function_tokens: def setBaudrate ( self , baudrate ) : try : b = int ( baudrate ) except TypeError : raise ValueError ( "Not a valid baudrate: %r" % ( baudrate , ) ) else : if b <= 0 : raise ValueError ( "Not a valid baudrate: %r" % ( baudrate , ) ) self . _baudrate = b if self . _isOpen : self . _reconfigurePort ( )