Ticket #2535: poll-for-exit.diff

File poll-for-exit.diff, 895 bytes (added by glyph, 7 years ago)

an very short hack to poll for process exit

  • twisted/internet/process.py

     
    277277        if not proto: 
    278278            assert 'r' not in childFDs.values() 
    279279            assert 'w' not in childFDs.values() 
     280        self.reactor = reactor 
    280281        if not signal.getsignal(signal.SIGCHLD): 
    281282            log.msg("spawnProcess called, but the SIGCHLD handler is not " 
    282283                    "installed. This probably means you have not yet " 
     
    661662        if not self.lostProcess: 
    662663            #print "maybe, but haven't .lostProcess yet" 
    663664            self.reapProcess() 
     665            if not self.lostProcess: 
     666                self.reactor.callLater(0.01, self.maybeCallProcessEnded) 
    664667            return 
    665668        try: 
    666669            exitCode = sig = None