diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2011-10-26 13:50:50 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2011-10-26 13:50:50 (GMT) |
| commit | e46ef289e142982d7bd592faa7b0f85470364c01 (patch) | |
| tree | cda253e03788f7db0a7cdcd05662f66b4455e298 /src/python/stdlib/test/crashers/mutation_inside_cyclegc.py | |
| parent | d0d0d62bbcbb5c3417f8cba419c83bac192ea985 (diff) | |
| download | powder-e46ef289e142982d7bd592faa7b0f85470364c01.zip powder-e46ef289e142982d7bd592faa7b0f85470364c01.tar.gz | |
Remove Python console stuff
Diffstat (limited to 'src/python/stdlib/test/crashers/mutation_inside_cyclegc.py')
| -rw-r--r-- | src/python/stdlib/test/crashers/mutation_inside_cyclegc.py | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/src/python/stdlib/test/crashers/mutation_inside_cyclegc.py b/src/python/stdlib/test/crashers/mutation_inside_cyclegc.py deleted file mode 100644 index 2b67398..0000000 --- a/src/python/stdlib/test/crashers/mutation_inside_cyclegc.py +++ /dev/null @@ -1,31 +0,0 @@ - -# The cycle GC collector can be executed when any GC-tracked object is -# allocated, e.g. during a call to PyList_New(), PyDict_New(), ... -# Moreover, it can invoke arbitrary Python code via a weakref callback. -# This means that there are many places in the source where an arbitrary -# mutation could unexpectedly occur. - -# The example below shows list_slice() not expecting the call to -# PyList_New to mutate the input list. (Of course there are many -# more examples like this one.) - - -import weakref - -class A(object): - pass - -def callback(x): - del lst[:] - - -keepalive = [] - -for i in range(100): - lst = [str(i)] - a = A() - a.cycle = a - keepalive.append(weakref.ref(a, callback)) - del a - while lst: - keepalive.append(lst[:]) |
