summaryrefslogtreecommitdiff
path: root/src/python/stdlib/test/crashers/gc_inspection.py
diff options
context:
space:
mode:
authorSimon 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)
commite46ef289e142982d7bd592faa7b0f85470364c01 (patch)
treecda253e03788f7db0a7cdcd05662f66b4455e298 /src/python/stdlib/test/crashers/gc_inspection.py
parentd0d0d62bbcbb5c3417f8cba419c83bac192ea985 (diff)
downloadpowder-e46ef289e142982d7bd592faa7b0f85470364c01.zip
powder-e46ef289e142982d7bd592faa7b0f85470364c01.tar.gz
Remove Python console stuff
Diffstat (limited to 'src/python/stdlib/test/crashers/gc_inspection.py')
-rw-r--r--src/python/stdlib/test/crashers/gc_inspection.py32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/python/stdlib/test/crashers/gc_inspection.py b/src/python/stdlib/test/crashers/gc_inspection.py
deleted file mode 100644
index 10caa79..0000000
--- a/src/python/stdlib/test/crashers/gc_inspection.py
+++ /dev/null
@@ -1,32 +0,0 @@
-"""
-gc.get_referrers() can be used to see objects before they are fully built.
-
-Note that this is only an example. There are many ways to crash Python
-by using gc.get_referrers(), as well as many extension modules (even
-when they are using perfectly documented patterns to build objects).
-
-Identifying and removing all places that expose to the GC a
-partially-built object is a long-term project. A patch was proposed on
-SF specifically for this example but I consider fixing just this single
-example a bit pointless (#1517042).
-
-A fix would include a whole-scale code review, possibly with an API
-change to decouple object creation and GC registration, and according
-fixes to the documentation for extension module writers. It's unlikely
-to happen, though. So this is currently classified as
-"gc.get_referrers() is dangerous, use only for debugging".
-"""
-
-import gc
-
-
-def g():
- marker = object()
- yield marker
- # now the marker is in the tuple being constructed
- [tup] = [x for x in gc.get_referrers(marker) if type(x) is tuple]
- print tup
- print tup[1]
-
-
-tuple(g())