Mercurial > hg
changeset 7727:25fc4c620e54
demandimport: patch __builtin__ instead of __builtins__
This helps on implementations other than CPython, where __builtins__ isn't
necessarily defined (as it's an implementation detail for CPython).
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Thu, 05 Feb 2009 17:40:25 +0100 |
parents | 2486980fe211 |
children | b7ac53f7b061 2e48668b51f0 |
files | mercurial/demandimport.py |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/demandimport.py Thu Feb 05 18:21:22 2009 +0100 +++ b/mercurial/demandimport.py Thu Feb 05 17:40:25 2009 +0100 @@ -24,6 +24,7 @@ b = __import__(a) ''' +import __builtin__ _origimport = __import__ class _demandmod(object): @@ -126,9 +127,9 @@ def enable(): "enable global demand-loading of modules" - __builtins__["__import__"] = _demandimport + __builtin__.__import__ = _demandimport def disable(): "disable global demand-loading of modules" - __builtins__["__import__"] = _origimport + __builtin__.__import__ = _origimport