cubicweb #3848995 autoreloading module fails [validation pending]

The autoreloading module fails when I make changes in the of my cube.

I've binded a function, defined in "", to the 'after-registry-reload' event. This function uses clojure by referencing hooks defined in the module. When I reload a web page of my application I get a "AttributeError: 'NoneType' object has no attribute '__regid__'".

You can reproduce this problem using the following code in

from cubicweb.server.hook import Hook
from cubicweb import onevent
class MyHook(Hook):
    __regid__ = 'myhook'
    def __call__(self):

def foo():
    print Hook.__regid__

Then you start the instance, change something in "" and reload a web page.

done in3.17.17
load left0.000
closed by#93a44cf0d030 [cwvreg] cleanup the event manager when reloading modules
patch[cwvreg] cleanup the event manager when reloading modules [applied]