From: Vladimir Marangozov Date: Sat, 15 Jul 2000 00:42:09 +0000 (+0000) Subject: Break a cycle created in the saboteur() function. X-Git-Tag: v2.0b1~821 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5ff2ac2fa96f2f58f574bdf5c07817bb8903fe2d;p=thirdparty%2FPython%2Fcpython.git Break a cycle created in the saboteur() function. --- diff --git a/Lib/test/test_extcall.py b/Lib/test/test_extcall.py index 6cca1994712d..de2312b1de3d 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})