def setUp(self):
        """
        Save the current SIGCHLD handler as reported by L{signal.signal} and
        the current file descriptor registered with L{installHandler}.
        """
        handler = signal.getsignal(signal.SIGCHLD)
        if handler != signal.SIG_DFL:
            self.signalModuleHandler = handler
            signal.signal(signal.SIGCHLD, signal.SIG_DFL)
        else:
            self.signalModuleHandler = None

        self.oldFD = self.installHandler(-1)

        if self.signalModuleHandler is not None and self.oldFD != -1:
            msg("SIGCHLD setup issue: %r %r" % (self.signalModuleHandler, self.oldFD))
            raise RuntimeError("You used some signal APIs wrong!  Try again.")
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/internet/test/test_sigchld.py/SIGCHLDTestsMixin.setUp/original