示例#1
0
 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
示例#2
0
 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
示例#3
0
 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)
示例#4
0
    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]
示例#5
0
 def runs_tcgetattr():
     try:
         rtermios.tcgetattr(338)
     except termios.error, e:
         return 2
示例#6
0
 def runs_tcgetattr():
     tpl = list(rtermios.tcgetattr(2)[:-1])
     return str(tpl)
示例#7
0
 def runs_tcgetattr(fd):
     try:
         rtermios.tcgetattr(fd)
     except OSError, e:
         return e.errno
示例#8
0
 def runs_tcgetattr():
     tpl = list(rtermios.tcgetattr(2)[:-1])
     return str(tpl)
示例#9
0
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)
示例#10
0
def tcgetattr(space, fd):
    try:
        tup = rtermios.tcgetattr(fd)
    except termios.error, e:
        e.errno = e.args[0]
        raise convert_error(space, e)
 def runs_tcgetattr():
     try:
         rtermios.tcgetattr(338)
     except termios.error, e:
         return 2
示例#12
0
def tcgetattr(space, fd):
    try:
        tup = rtermios.tcgetattr(fd)
    except OSError, e:
        raise convert_error(space, e)