You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the ModuleWatcher class should have a method called 'blacklist', which takes a fully qualified module name as an argument.
A blacklisted module will be added, unsurprisingly, to a blacklist. Any modules that import this module will also be blacklisted. This will be achieved using an import tracer (repurposed from labscript_utils.impprof) that is set up when a ModuleWatcher is instantiated.
Blacklisted modules shouldn't be deleted from sys.modules immediately, that wouldn't make sense. They will be deleted on a method call 'clear_blacklisted' or similar.
This functionality is so that calling code can blacklist a module that it knows has import side effects and thus needs to be re-imported in code that runs repeatedly in the same interpreter, like lyse routines and labscript compilation.
So that far away code can blacklist itself, ModuleWatcher should provide access to an existing instance.
The text was updated successfully, but these errors were encountered:
Original report (archived issue) by Chris Billington (Bitbucket: cbillington, GitHub: chrisjbillington).
the ModuleWatcher class should have a method called 'blacklist', which takes a fully qualified module name as an argument.
A blacklisted module will be added, unsurprisingly, to a blacklist. Any modules that import this module will also be blacklisted. This will be achieved using an import tracer (repurposed from labscript_utils.impprof) that is set up when a ModuleWatcher is instantiated.
Blacklisted modules shouldn't be deleted from sys.modules immediately, that wouldn't make sense. They will be deleted on a method call 'clear_blacklisted' or similar.
This functionality is so that calling code can blacklist a module that it knows has import side effects and thus needs to be re-imported in code that runs repeatedly in the same interpreter, like lyse routines and labscript compilation.
So that far away code can blacklist itself, ModuleWatcher should provide access to an existing instance.
The text was updated successfully, but these errors were encountered: