  
          # First, look for an many-to-many relationship to Site.
          for field in opts.many_to_many:
              if field.remote_field.model is Site:
                  with suppress(IndexError):
                      # Caveat: In the case of multiple related Sites, this just
                      # selects the *first* one, which is arbitrary.
                      object_domain = getattr(obj, field.name).all()[0].domain
                  if object_domain is not None:
                      break
 
</s> remove             with suppress(Site.DoesNotExist):
 </s> add             try: </s> remove             # SuspiciousFileOperation occurs if the jointed path is located
            # outside of this template_dir (it might be inside another one,
            # so this isn't fatal).
            with suppress(SuspiciousFileOperation):
 </s> add             try:
                try:
  
          # First, look for an many-to-many relationship to Site.
          for field in opts.many_to_many:
              if field.remote_field.model is Site:
                try:
                      # Caveat: In the case of multiple related Sites, this just
                      # selects the *first* one, which is arbitrary.
                      object_domain = getattr(obj, field.name).all()[0].domain
                  if object_domain is not None:
                      break
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/contenttypes/views.py