def close_connection (self):
        """
        Close an opened url connection.
        """
        if self.url_connection is None:
            # no connection is open
            return
        try:
            self.url_connection.close()
        except Exception:
            # ignore close errors
            pass
        self.url_connection = None
def close_connection ( self ) : if self . url_connection is None : return try : self . url_connection . close ( ) except Exception : pass self . url_connection = None
Close an opened url connection.