def runs_tcsetattr(): tp = rtermios.tcgetattr(2) a, b, c, d, e, f, g = tp rtermios.tcsetattr(2, rtermios.TCSANOW, (a, b, c, d, e, f, g)) time.sleep(1) tp = rtermios.tcgetattr(2) assert tp[5] == f
def test_tcsetattr_icanon(self): from pypy.rlib import rtermios import termios def check(fd, when, attributes): count = len([i for i in attributes[-1] if isinstance(i, int)]) assert count == 2 termios.tcsetattr = check attr = list(rtermios.tcgetattr(2)) attr[3] |= termios.ICANON rtermios.tcsetattr(2, termios.TCSANOW, attr)
def test_tcgetattr(self): from pypy.translator.c.test.test_genc import compile import termios from pypy.rlib import rtermios def runs_tcgetattr(): tpl = list(rtermios.tcgetattr(2)[:-1]) return str(tpl) fn = compile(runs_tcgetattr, [], backendopt=False) res = fn() res2 = str(rtermios.tcgetattr(2)[:-1]) assert res[1:-1] == res2[1:-1]
def runs_tcgetattr(): try: rtermios.tcgetattr(338) except termios.error, e: return 2
def runs_tcgetattr(): tpl = list(rtermios.tcgetattr(2)[:-1]) return str(tpl)
def runs_tcgetattr(fd): try: rtermios.tcgetattr(fd) except OSError, e: return e.errno
def tcgetattr(space, w_fd): fd = space.c_filedescriptor_w(w_fd) try: tup = rtermios.tcgetattr(fd) except OSError, e: raise convert_error(space, e)
def tcgetattr(space, fd): try: tup = rtermios.tcgetattr(fd) except termios.error, e: e.errno = e.args[0] raise convert_error(space, e)
def tcgetattr(space, fd): try: tup = rtermios.tcgetattr(fd) except OSError, e: raise convert_error(space, e)