          try:
              # First, try to get the "index" sitemap URL.
              sitemap_url = reverse('django.contrib.sitemaps.views.index')
          except NoReverseMatch:
              with suppress(NoReverseMatch):
                  # Next, try for the "global" sitemap URL.
                  sitemap_url = reverse('django.contrib.sitemaps.views.sitemap')
  
      if sitemap_url is None:
          raise SitemapNotFound("You didn't provide a sitemap_url, and the sitemap URL couldn't be auto-detected.")
 
</s> remove             with suppress(NoReverseMatch):
 </s> add             try: </s> remove                 with suppress(IndexError):
 </s> add                 try: </s> remove         with suppress(OSError):
 </s> add         try:
            try:
          try:
              # First, try to get the "index" sitemap URL.
              sitemap_url = reverse('django.contrib.sitemaps.views.index')
          except NoReverseMatch:
            try:
                  # Next, try for the "global" sitemap URL.
                  sitemap_url = reverse('django.contrib.sitemaps.views.sitemap')
  
      if sitemap_url is None:
          raise SitemapNotFound("You didn't provide a sitemap_url, and the sitemap URL couldn't be auto-detected.")
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/sitemaps/__init__.py