              except pickle.PickleError:
                  return default
  
          with (self._lock.writer() if acquire_lock else dummy()):
              with suppress(KeyError):
                  del self._cache[key]
                  del self._expire_info[key]
              return default
  
      def _set(self, key, value, timeout=DEFAULT_TIMEOUT):
 
</s> remove 
        with suppress(KeyError):
 </s> add         except KeyError:
            pass
        try: </s> remove             with suppress(KeyError):
 </s> add             try: </s> remove         with suppress(KeyError):
 </s> add         try:
            try:
              except pickle.PickleError:
                  return default
  
          with (self._lock.writer() if acquire_lock else dummy()):
            try:
                  del self._cache[key]
                  del self._expire_info[key]
              return default
  
      def _set(self, key, value, timeout=DEFAULT_TIMEOUT):
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/core/cache/backends/locmem.py