]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.2/Lib/test/crashers/mutation_inside_cyclegc.py
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Lib / test / crashers / mutation_inside_cyclegc.py
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Lib/test/crashers/mutation_inside_cyclegc.py b/AppPkg/Applications/Python/Python-2.7.2/Lib/test/crashers/mutation_inside_cyclegc.py
deleted file mode 100644 (file)
index 82ee72d..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-\r
-# The cycle GC collector can be executed when any GC-tracked object is\r
-# allocated, e.g. during a call to PyList_New(), PyDict_New(), ...\r
-# Moreover, it can invoke arbitrary Python code via a weakref callback.\r
-# This means that there are many places in the source where an arbitrary\r
-# mutation could unexpectedly occur.\r
-\r
-# The example below shows list_slice() not expecting the call to\r
-# PyList_New to mutate the input list.  (Of course there are many\r
-# more examples like this one.)\r
-\r
-\r
-import weakref\r
-\r
-class A(object):\r
-    pass\r
-\r
-def callback(x):\r
-    del lst[:]\r
-\r
-\r
-keepalive = []\r
-\r
-for i in range(100):\r
-    lst = [str(i)]\r
-    a = A()\r
-    a.cycle = a\r
-    keepalive.append(weakref.ref(a, callback))\r
-    del a\r
-    while lst:\r
-        keepalive.append(lst[:])\r