瀏覽代碼

PromiseProxy: Only remove original object if evaluation succeeded

Ask Solem 11 年之前
父節點
當前提交
5892ba2566
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      celery/local.py

+ 3 - 1
celery/local.py

@@ -251,7 +251,9 @@ class PromiseProxy(Proxy):
             thing = Proxy._get_current_object(self)
             object.__setattr__(self, '__thing', thing)
             return thing
-        finally:
+        except:
+            raise
+        else:
             for attr in _clean:
                 try:
                     object.__delattr__(self, attr)