summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Marangozov <vladimir.marangozov@t-online.de>2000-07-15 00:42:09 (GMT)
committerVladimir Marangozov <vladimir.marangozov@t-online.de>2000-07-15 00:42:09 (GMT)
commit5ff2ac2fa96f2f58f574bdf5c07817bb8903fe2d (patch)
treeb71cedd4c3a4c9b1e103ddcd8fb50fb0a6b2ad64
parenta44923fbfe9c48f04dce9e8e111e9b898f60d14b (diff)
downloadcpython-5ff2ac2fa96f2f58f574bdf5c07817bb8903fe2d.zip
cpython-5ff2ac2fa96f2f58f574bdf5c07817bb8903fe2d.tar.gz
cpython-5ff2ac2fa96f2f58f574bdf5c07817bb8903fe2d.tar.bz2
Break a cycle created in the saboteur() function.
-rw-r--r--Lib/test/test_extcall.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_extcall.py b/Lib/test/test_extcall.py
index 6cca199..de2312b 100644
--- a/Lib/test/test_extcall.py
+++ b/Lib/test/test_extcall.py
@@ -85,10 +85,13 @@ assert d == d2, "function call modified dictionary"
# what about willful misconduct?
def saboteur(**kw):
- kw['x'] = locals()
+ kw['x'] = locals() # yields a cyclic kw
+ return kw
d = {}
-saboteur(a=1, **d)
+kw = saboteur(a=1, **d)
assert d == {}
+# break the cycle
+del kw['x']
try:
g(1, 2, 3, **{'x':4, 'y':5})