          try:
              return t.to_language()
      # If we don't have a real translation object, assume it's the default language.
      return settings.LANGUAGE_CODE
  
  
  def get_language_bidi():
 
</s> remove         with suppress(AttributeError):
 </s> add         try: </s> remove             with suppress(GDALException):
 </s> add             try: </s> remove         with suppress(KeyError):
 </s> add         try: </s> remove         with suppress(TypeError):  # len() of unsized object.
 </s> add         try:
        except AttributeError:
            pass
          try:
              return t.to_language()
        except AttributeError:
            pass
      # If we don't have a real translation object, assume it's the default language.
      return settings.LANGUAGE_CODE
  
  
  def get_language_bidi():
keep add 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/utils/translation/trans_real.py