def join(self): """Similar to Popen.wait(), but returns the value wrapped in a list, and ensures that any opened handles are closed. Must be called before calling commit.""" if not self._proc: return [None] self._running = False return_code = self._proc.wait() if return_code < 0: return_code = signals.to_str(-return_code) return [return_code]
def join(self): """Similar to Popen.wait(), but returns the value wrapped in a list, and ensures that any opened handles are closed. Must be called before calling commit.""" try: if not self._proc: return [None] return_code = self._proc.wait() if return_code < 0: return_code = signals.to_str(-return_code) return [return_code] finally: # Close any implictly opened pipes for (mode, handle) in self._handles.values(): if "w" in mode: handle.flush() handle.close() self._handles = {}
def test_signal__to_str__wrong_type(): signals.to_str("SIGTERM")
def test_signal__to_str__unknown_signal(): signals.to_str(1024)
def test_signal__sigterm_to_str(): assert_equal(signals.to_str(signal.SIGTERM), "SIGTERM")