def send_request ( self , * args , * * kwargs ) : try : return self . session . request ( * args , * * kwargs ) except ConnectionError : self . session . close ( ) return self . session . request ( * args , * * kwargs )
allow in secure connection python requests
Wrapper for session . request Handle connection reset error even from pyopenssl
def send_request(self, *args, **kwargs):
        """Wrapper for session.request
        Handle connection reset error even from pyopenssl
        """
        try:
            return self.session.request(*args, **kwargs)
        except ConnectionError:
            self.session.close()
            return self.session.request(*args, **kwargs)