MCPcopy
hub / github.com/Gallopsled/pwntools / poll

Method poll

pwnlib/tubes/process.py:668–698  ·  view source on GitHub ↗

poll(block = False) -> int Arguments: block(bool): Wait for the process to exit Poll the exit code of the process. Will return None, if the process has not yet finished and the exit code otherwise.

(self, block = False)

Source from the content-addressed store, hash-verified

666 self.close()
667
668 def poll(self, block = False):
669 """poll(block = False) -> int
670
671 Arguments:
672 block(bool): Wait for the process to exit
673
674 Poll the exit code of the process. Will return None, if the
675 process has not yet finished and the exit code otherwise.
676 """
677
678 # In order to facilitate retrieving core files, force an update
679 # to the current working directory
680 _ = self.cwd
681
682 if block:
683 self.wait_for_close()
684
685 self.proc.poll()
686 returncode = self.proc.returncode
687
688 if returncode is not None and not self._stop_noticed:
689 self._stop_noticed = time.time()
690 signame = ''
691 if returncode < 0:
692 signame = ' (%s)' % (signal_names.get(returncode, 'SIG???'))
693
694 self.info("Process %r stopped with exit code %d%s (pid %i)" % (self.display,
695 returncode,
696 signame,
697 self.pid))
698 return returncode
699
700 def communicate(self, stdin = None):
701 """communicate(stdin = None) -> str

Callers 6

recv_rawMethod · 0.95
send_rawMethod · 0.95
connected_rawMethod · 0.95
closeMethod · 0.95
libsMethod · 0.95
corefileMethod · 0.95

Calls 3

wait_for_closeMethod · 0.80
infoMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected