def _connect_to_upstream(self):
        if self.proxy_server:
            upstream_sock = socks.socksocket()
            upstream_sock.set_proxy(**self.proxy_server)
        else:
            upstream_sock = socket.socket()

        try:
            upstream_sock.settimeout(self.proxy_timeout)
            upstream_sock.connect(self.upstream)
            if self.use_ssl:
                upstream_sock = wrap_ssl(upstream_sock)
        except:
            drop_socket(upstream_sock)
            raise

        self.logger.info(
            self.upstream % 'Connected to upstream %s:%d')
        return upstream_sock
dataset/ETHPy150Open tonyseek/rsocks/rsocks/server.py/ReverseProxyServer._connect_to_upstream/swapped operands of `%`