Mercurial > hg
comparison tests/test-demandimport.py.out @ 32448:91a2ec8e7fa0
demandimport: stop overriding __getattribute__()
Proxy __dict__ and __doc__ explicitly instead.
I'm not sure which is less evil, but this seems slightly simpler than hooking
all attribute accesses.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Fri, 28 Apr 2017 00:01:22 +0900 |
parents | 252d2260c74e |
children | b39f0fdb0338 |
comparison
equal
deleted
inserted
replaced
32447:252d2260c74e | 32448:91a2ec8e7fa0 |
---|---|
16 fred = <proxied module 're'> | 16 fred = <proxied module 're'> |
17 remod = <module 're' from '?'> | 17 remod = <module 're' from '?'> |
18 re = <unloaded module 'sys'> | 18 re = <unloaded module 'sys'> |
19 re.stderr = <open file '<whatever>', mode 'w' at 0x?> | 19 re.stderr = <open file '<whatever>', mode 'w' at 0x?> |
20 re = <proxied module 'sys'> | 20 re = <proxied module 'sys'> |
21 pvecproxy = <unloaded module 'pvec'> | |
22 pvecproxy.__doc__ = 'A "pvec" is ...' | |
23 pvecproxy.__name__ = 'mercurial.pvec' | |
24 pvecproxy.__dict__['__name__'] = 'mercurial.pvec' | |
25 pvecproxy = <proxied module 'pvec'> | |
21 contextlib = <unloaded module 'contextlib'> | 26 contextlib = <unloaded module 'contextlib'> |
22 contextlib.unknownattr = ImportError: cannot import name unknownattr | 27 contextlib.unknownattr = ImportError: cannot import name unknownattr |
23 __import__('contextlib', ..., ['unknownattr']) = <module 'contextlib' from '?'> | 28 __import__('contextlib', ..., ['unknownattr']) = <module 'contextlib' from '?'> |
24 hasattr(contextlibimp, 'unknownattr') = False | 29 hasattr(contextlibimp, 'unknownattr') = False |
25 node = <module 'mercurial.node' from '?'> | 30 node = <module 'mercurial.node' from '?'> |