# HG changeset patch
# User Sylvain <syt@logilab.fr>
# Date 1212655654 -7200
#      Thu Jun 05 10:47:34 2008 +0200
# Node ID dd3597baee8e96fac47f58cc1c159d3d302dc6ac
# Parent  68e24fceb3ffe1ba25e57beceb8a20c4a0d8f84f
error resilient unregister_reference

diff --git a/nodes.py b/nodes.py
--- a/nodes.py
+++ b/nodes.py
@@ -907,7 +907,11 @@
         
     def unregister_reference(self, vref):
         """remove a reference to this variable"""
-        self.stinfo['references'].remove(vref)
+        try:
+            self.stinfo['references'].remove(vref)
+        except KeyError:
+            # this may occur on hairy undoing
+            pass
 
     def references(self):
         """return all references on this variable"""