Explorar o código

PromiseProxy: Only remove original object if evaluation succeeded

Ask Solem %!s(int64=11) %!d(string=hai) anos
pai
achega
924f3076f6
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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)