def close_connection ( self ) : 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
python 'connection' object has no attribute 'delete'
Close an opened url connection .
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