def __init__(self, response):
        """Initialize a Redirect exception instance.

        :param response: A requests.response instance containing a location
        header.

        """
        path = urlparse(response.headers["location"]).path
        self.path = path[:-5] if path.endswith(".json") else path
        self.response = response
        PrawcoreException.__init__(self, "Redirect to {}".format(self.path))
def __init__ ( self , response ) : path = urlparse ( response . headers [ "location" ] ) . path self . path = path [ : - 5 ] if path . endswith ( ".json" ) else path self . response = response PrawcoreException . __init__ ( self , "Redirect to {}" . format ( self . path ) )
Initialize a Redirect exception instance.

        :param response: A requests.response instance containing a location
        header.