          #
          # See ticket #8616.
          dir, prefix = os.path.split(session_file_name)
  
          with suppress(OSError, IOError, EOFError):
              output_file_fd, output_file_name = tempfile.mkstemp(dir=dir, prefix=prefix + '_out_')
              renamed = False
              try:
                  try:
                      os.write(output_file_fd, self.encode(session_data).encode())
 
</s> remove with suppress(ImportError):
 </s> add try: </s> remove     with suppress(AttributeError):
 </s> add     try:
        try:
          #
          # See ticket #8616.
          dir, prefix = os.path.split(session_file_name)
  
        try:
              output_file_fd, output_file_name = tempfile.mkstemp(dir=dir, prefix=prefix + '_out_')
              renamed = False
              try:
                  try:
                      os.write(output_file_fd, self.encode(session_data).encode())
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/sessions/backends/file.py