          # Determine domain
          if site is None:
              if django_apps.is_installed('django.contrib.sites'):
                  Site = django_apps.get_model('sites.Site')
                  with suppress(Site.DoesNotExist):
                      site = Site.objects.get_current()
              if site is None:
                  raise ImproperlyConfigured(
                      "To use sitemaps, either enable the sites framework or pass "
                      "a Site/RequestSite object in your view."
 
</s> remove             with suppress(Site.DoesNotExist):
 </s> add             try: </s> remove     with suppress(KeyError):
 </s> add     try:
                try:
          # Determine domain
          if site is None:
              if django_apps.is_installed('django.contrib.sites'):
                  Site = django_apps.get_model('sites.Site')
                try:
                      site = Site.objects.get_current()
              if site is None:
                  raise ImproperlyConfigured(
                      "To use sitemaps, either enable the sites framework or pass "
                      "a Site/RequestSite object in your view."
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