Browse Source

Added check for 1.0.2 before remove attr

Vitaly Babiy 15 years ago
parent
commit
396eb6b103
1 changed files with 2 additions and 1 deletions
  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._was_closed = False
         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):
             cache._was_closed = True