def _recalculate_modularity_safe(self):
    'Recalculates the stored modularity value and swallows all exceptions\n        raised by the modularity function (if any).\n\n        @return: the new modularity score or C{None} if the modularity function\n        could not be calculated.\n        '
    try:
        return self.recalculate_modularity()
    except:
        return None
    finally:
        self._modularity_dirty = False
Recalculates the stored modularity value and swallows all exceptions
raised by the modularity function (if any).

@return: the new modularity score or C{None} if the modularity function
could not be calculated.
def _recalculate_modularity_safe(self):
    'Recalculates the stored modularity value and swallows all exceptions\n        raised by the modularity function (if any).\n\n        @return: the new modularity score or C{None} if the modularity function\n        could not be calculated.\n        '
    try:
        return self.recalculate_modularity()
    except:
        return None
    finally:
        self._modularity_dirty = False