          try:
              return self._get_from_cache(opts)
  
          # The ContentType entry was not found in the cache, therefore we
          # proceed to load or create it.
          try:
              # Start with get() and not get_or_create() in order to use
              # the db_for_read (see #20401).
 
</s> remove         with suppress(KeyError):
 </s> add         try: </s> remove     with suppress(KeyError):
 </s> add     try: </s> remove             with suppress(KeyError):
 </s> add             try: </s> remove             with suppress(GDALException):
 </s> add             try:
        except KeyError:
            pass
          try:
              return self._get_from_cache(opts)
        except KeyError:
            pass
  
          # The ContentType entry was not found in the cache, therefore we
          # proceed to load or create it.
          try:
              # Start with get() and not get_or_create() in order to use
              # the db_for_read (see #20401).
keep add keep 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/contenttypes/models.py