code: def openpty():
      
      try:
          return os.openpty()
      except OSError:
          e = sys.exc_info()[1]
          if IS_LINUX and e.args[0] == errno.EPERM:
              return _linux_broken_devpts_openpty()
          raise mitogen.core.StreamError(OPENPTY_MSG, e)
docs: Call :func:`os.openpty`, raising a descriptive error if the call fails.
  
      :raises mitogen.core.StreamError:
          Creating a PTY failed.
      :returns:
          See :func`os.openpty`.