Exemplo n.º 1
0
    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]
Exemplo n.º 2
0
    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]
Exemplo n.º 3
0
    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 = {}
Exemplo n.º 4
0
    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 = {}
Exemplo n.º 5
0
def test_signal__to_str__wrong_type():
    signals.to_str("SIGTERM")
Exemplo n.º 6
0
def test_signal__to_str__unknown_signal():
    signals.to_str(1024)
Exemplo n.º 7
0
def test_signal__sigterm_to_str():
    assert_equal(signals.to_str(signal.SIGTERM), "SIGTERM")