MCPcopy Create free account
hub / github.com/pexpect/pexpect / main

Function main

tests/platform_checks/check_handler.py:31–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29 GLOBAL_SIGCHLD_RECEIVED = 1
30
31def main ():
32 signal.signal (signal.SIGCHLD, signal_handler)
33 pid, fd = pty.fork()
34 if pid == 0:
35 os.write (sys.stdout.fileno(), 'This is a test.\nThis is a test.')
36 time.sleep(10000)
37 nonblock (fd)
38 tty.setraw(fd) #STDIN_FILENO)
39 print 'Sending SIGKILL to child pid:', pid
40 time.sleep(2)
41 os.kill (pid, signal.SIGKILL)
42
43 print 'Entering to sleep...'
44 try:
45 time.sleep(2)
46 except:
47 print 'Sleep interrupted'
48 try:
49 os.kill(pid, 0)
50 print '\tChild is alive. This is ambiguous because it may be a Zombie.'
51 except OSError as e:
52 print '\tChild appears to be dead.'
53# print str(e)
54 print
55 print 'Reading from master fd:', os.read (fd, 1000)
56
57
58

Callers 1

check_handler.pyFile · 0.70

Calls 5

nonblockFunction · 0.85
filenoMethod · 0.80
readMethod · 0.80
writeMethod · 0.45
killMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…