| 50 | self.loop = self |
| 51 | |
| 52 | class GC_Detector(object): |
| 53 | # Create an instance I. Then gc hasn't happened again so long as |
| 54 | # I.gc_happened is false. |
| 55 | |
| 56 | def __init__(self): |
| 57 | self.gc_happened = False |
| 58 | |
| 59 | def it_happened(ignored): |
| 60 | self.gc_happened = True |
| 61 | |
| 62 | # Create a piece of cyclic trash that triggers it_happened when |
| 63 | # gc collects it. |
| 64 | self.wr = weakref.ref(C1055820(666), it_happened) |
| 65 | |
| 66 | @with_tp_del |
| 67 | class Uncollectable(object): |
no outgoing calls
searching dependent graphs…