Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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)
Exemplo n.º 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]
Exemplo n.º 5
0
 def runs_tcgetattr():
     try:
         rtermios.tcgetattr(338)
     except termios.error, e:
         return 2
Exemplo n.º 6
0
 def runs_tcgetattr():
     tpl = list(rtermios.tcgetattr(2)[:-1])
     return str(tpl)
Exemplo n.º 7
0
 def runs_tcgetattr(fd):
     try:
         rtermios.tcgetattr(fd)
     except OSError, e:
         return e.errno
Exemplo n.º 8
0
 def runs_tcgetattr():
     tpl = list(rtermios.tcgetattr(2)[:-1])
     return str(tpl)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 11
0
 def runs_tcgetattr():
     try:
         rtermios.tcgetattr(338)
     except termios.error, e:
         return 2
Exemplo n.º 12
0
def tcgetattr(space, fd):
    try:
        tup = rtermios.tcgetattr(fd)
    except OSError, e:
        raise convert_error(space, e)