          a Feature is found matching the given feature ID.
          """
          if self._random_read:
              # If the Layer supports random reading, return.
              with suppress(GDALException):
                  return Feature(capi.get_feature(self.ptr, feat_id), self)
          else:
              # Random access isn't supported, have to increment through
              # each feature until the given feature ID is encountered.
              for feat in self:
 
</s> remove     with suppress(KeyError):
 </s> add     try: </s> remove         with suppress(AttributeError):
 </s> add         try:
            try:
          a Feature is found matching the given feature ID.
          """
          if self._random_read:
              # If the Layer supports random reading, return.
            try:
                  return Feature(capi.get_feature(self.ptr, feat_id), self)
          else:
              # Random access isn't supported, have to increment through
              # each feature until the given feature ID is encountered.
              for feat in self:
keep keep keep keep replace keep keep keep keep keep
 Reverted "Fixed #27818 -- Replaced try/except/pass with contextlib.suppress()."

This reverts commit 550cb3a365dee4edfdd1563224d5304de2a57fda
because try/except performs better. 
django/contrib/gis/gdal/layer.py