Show More
@@ -132,8 +132,11 b' class _demandmod(object):' | |||
|
132 | 132 | subload(mod, x) |
|
133 | 133 | |
|
134 | 134 | # Replace references to this proxy instance with the actual module. |
|
135 |
if locals |
|
|
136 |
locals |
|
|
135 | if locals: | |
|
136 | if locals.get(head) is self: | |
|
137 | locals[head] = mod | |
|
138 | elif locals.get(head + r'mod') is self: | |
|
139 | locals[head + r'mod'] = mod | |
|
137 | 140 | |
|
138 | 141 | for modname in modrefs: |
|
139 | 142 | modref = sys.modules.get(modname, None) |
@@ -52,6 +52,9 b' print("hgweb =", f(hgweb))' | |||
|
52 | 52 | import re as fred |
|
53 | 53 | print("fred =", f(fred)) |
|
54 | 54 | |
|
55 | import re as remod | |
|
56 | print("remod =", f(remod)) | |
|
57 | ||
|
55 | 58 | import sys as re |
|
56 | 59 | print("re =", f(re)) |
|
57 | 60 | |
@@ -59,6 +62,9 b' print("fred =", f(fred))' | |||
|
59 | 62 | print("fred.sub =", f(fred.sub)) |
|
60 | 63 | print("fred =", f(fred)) |
|
61 | 64 | |
|
65 | remod.escape # use remod | |
|
66 | print("remod =", f(remod)) | |
|
67 | ||
|
62 | 68 | print("re =", f(re)) |
|
63 | 69 | print("re.stderr =", f(re.stderr)) |
|
64 | 70 | print("re =", f(re)) |
@@ -9,10 +9,12 b" hgweb = <unloaded module 'hgweb'>" | |||
|
9 | 9 | hgweb_mod = <unloaded module 'hgweb_mod'> |
|
10 | 10 | hgweb = <module 'mercurial.hgweb' from '?'> |
|
11 | 11 | fred = <unloaded module 're'> |
|
12 | remod = <unloaded module 're'> | |
|
12 | 13 | re = <unloaded module 'sys'> |
|
13 | 14 | fred = <unloaded module 're'> |
|
14 | 15 | fred.sub = <function sub at 0x?> |
|
15 | 16 | fred = <proxied module 're'> |
|
17 | remod = <module 're' from '?'> | |
|
16 | 18 | re = <unloaded module 'sys'> |
|
17 | 19 | re.stderr = <open file '<whatever>', mode 'w' at 0x?> |
|
18 | 20 | re = <proxied module 'sys'> |
General Comments 0
You need to be logged in to leave comments.
Login now