Ver Fonte

Added check for 1.0.2 before remove attr

Vitaly Babiy há 16 anos atrás
pai
commit
396eb6b103
1 ficheiros alterados com 2 adições e 1 exclusões
  1. 2 1
      celery/tests/test_worker_job.py

+ 2 - 1
celery/tests/test_worker_job.py

@@ -72,7 +72,8 @@ class TestJail(unittest.TestCase):
         cache.settings.CACHE_BACKEND = "libmemcached"
         cache.settings.CACHE_BACKEND = "libmemcached"
         cache._was_closed = False
         cache._was_closed = False
         old_cache_parse_backend = getattr(cache, "parse_backend_uri", None)
         old_cache_parse_backend = getattr(cache, "parse_backend_uri", None)
-        delattr(cache, 'parse_backend_uri')
+        if old_cache_parse_backend: # checks to make sure attr exists
+            delattr(cache, 'parse_backend_uri')
 
 
         def monkeypatched_cache_close(*args, **kwargs):
         def monkeypatched_cache_close(*args, **kwargs):
             cache._was_closed = True
             cache._was_closed = True