def __init__(self, requestHandler, ssl=False):
        # this is racy :-(
        self.port = testhelp.findPorts(num = 1)[0]
        self.ssl = ssl

        self.childPid = os.fork()
        if 0 > self.childPid:
            sock_utils.tryConnect("127.0.0.1", self.port)
            return

        try:
            try:
                if ssl:
                    klass = SecureHTTPServer
                    ctx = SSL.Context("sslv23")
                    if isinstance(ssl, tuple):
                        # keypair
                        sslCert, sslKey = ssl
                    else:
                        # defaults
                        sslCert, sslKey = 'ssl-cert.crt', 'ssl-cert.key'
                    sslCert = os.path.join(resources.get_archive(sslCert))
                    sslKey = os.path.join(resources.get_archive(sslKey))
                    ctx.load_cert_chain(sslCert, sslKey)
                    args = (ctx,)
                else:
                    klass = BaseHTTPServer.HTTPServer
                    args = ()
                # Sorry for modifying a stdlib class, but this is in a dead-end
                # forked process after all! Need to bind to "IPv6 all" so that
                # both IPv4 and IPv6 connections to "localhost" succeed.
                klass.address_family = socket.AF_INET6
                httpServer = klass(('::', self.port), requestHandler, *args)
                httpServer.serve_forever()
                os._exit(0)
            except:
                traceback.print_exc()
        finally:
            os._exit(1)
dataset/ETHPy150Open sassoftware/conary/conary_test/rephelp.py/HTTPServerController.__init__/swapped operands of `>`