]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.2/Lib/test/crashers/gc_has_finalizer.py
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Lib / test / crashers / gc_has_finalizer.py
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Lib/test/crashers/gc_has_finalizer.py b/AppPkg/Applications/Python/Python-2.7.2/Lib/test/crashers/gc_has_finalizer.py
deleted file mode 100644 (file)
index 10b6124..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-"""\r
-The gc module can still invoke arbitrary Python code and crash.\r
-This is an attack against _PyInstance_Lookup(), which is documented\r
-as follows:\r
-\r
-    The point of this routine is that it never calls arbitrary Python\r
-    code, so is always "safe":  all it does is dict lookups.\r
-\r
-But of course dict lookups can call arbitrary Python code.\r
-The following code causes mutation of the object graph during\r
-the call to has_finalizer() in gcmodule.c, and that might\r
-segfault.\r
-"""\r
-\r
-import gc\r
-\r
-\r
-class A:\r
-    def __hash__(self):\r
-        return hash("__del__")\r
-    def __eq__(self, other):\r
-        del self.other\r
-        return False\r
-\r
-a = A()\r
-b = A()\r
-\r
-a.__dict__[b] = 'A'\r
-\r
-a.other = b\r
-b.other = a\r
-\r
-gc.collect()\r
-del a, b\r
-\r
-gc.collect()\r