Source

trac-ticketlinks / trac / core.py

Diff from to

File trac/core.py

                     break
             def maybe_init(self, compmgr, init=init, cls=new_class):
                 if cls not in compmgr.components:
+                    compmgr.components[cls] = self
                     if init:
-                        init(self)
-                    compmgr.components[cls] = self
+                        try:
+                            init(self)
+                        except:
+                            del compmgr.components[cls]
+                            raise
             maybe_init._original = init
             new_class.__init__ = maybe_init