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