[IronPython] Patching sys.modules to hide CLR 'modules'

William Reade william at resolversystems.com
Tue Mar 20 20:10:05 CET 2007


Hi all

I recently wanted to do as described in the subject line. However, it 
seems that when I import (say) System.Drawing, there is no detectable 
change to sys.modules, and so I cannot temporarily replace it with my 
own module in order to substitute simpler functionality for testing 
purposes*. Is this correct? If so, can I work around it, and what 
exciting pitfalls will I walk into if I try?

William

* That is to say, I cannot monkey-patch anything in sys.modules that 
didn't come from IronPython.

-- 
William Reade
Resolver Systems
william at resolversystems.com

Office address:     17a Clerkenwell Road, London EC1M 5RD, UK
Registered address: 843 Finchley Road, London NW11 8NA, UK

Resolver Systems Limited is registered in England and Wales as company number 5467329. 




More information about the Ironpython-users mailing list