server/sources/native.py
branchstable
changeset 5128 e5d300d75519
parent 5107 3694bd379513
child 5131 88b5ca8da928
--- a/server/sources/native.py	Thu Apr 01 08:24:11 2010 +0200
+++ b/server/sources/native.py	Thu Apr 01 08:24:53 2010 +0200
@@ -482,10 +482,12 @@
             except AttributeError:
                 assert event == 'deleted'
                 getattr(storage, 'entity_deleted')(entity, attr)
-        yield # 2/ execute the source's instructions
-        # 3/ restore original values
-        for attr, value in orig_values.items():
-            entity[attr] = value
+        try:
+            yield # 2/ execute the source's instructions
+        finally:
+            # 3/ restore original values
+            for attr, value in orig_values.items():
+                entity[attr] = value
 
     def add_entity(self, session, entity):
         """add a new entity to the source"""