[Zope-Coders] CallProfiler and Refresh.

Shane Hathaway shane@zope.com
Mon, 20 May 2002 10:44:06 -0400


Anthony Baxter wrote:
> As far as I can see, refreshing CallProfiler when the hooks are installed
> is a great way to hose your publisher. It doesn't seem like there's a way
> to say 'uninstall the hooks first' at all. As far as I can see, the module's
> being nuked and this is causing the module-level globals to be set to None.

It actually just removes the modules of your products from sys.modules 
then re-imports.  Refresh once used reload(), but that was awfully 
unpredictable, even when it precomputed dependencies.

A workaround is to set a global variable called "__refresh_module__" to 
0 in the specific module that should be ignored.

Shane