~inkscape.dev/inkscape-devlibs64/trunk

« back to all changes in this revision

Viewing changes to python/Lib/test/crashers/borrowed_ref_1.py

  • Committer: Eduard Braun
  • Date: 2016-10-22 16:51:19 UTC
  • Revision ID: eduard.braun2@gmx.de-20161022165119-9eosgy6lp8j1kzli
Update Python to version 2.7.12

Included modules:
  coverage 4.2
  lxml 3.6.4
  numpy 1.11.2
  scour 0.35
  six 1.10.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
"""
2
 
_PyType_Lookup() returns a borrowed reference.
3
 
This attacks the call in dictobject.c.
4
 
"""
5
 
 
6
 
class A(object):
7
 
    pass
8
 
 
9
 
class B(object):
10
 
    def __del__(self):
11
 
        print 'hi'
12
 
        del D.__missing__
13
 
 
14
 
class D(dict):
15
 
    class __missing__:
16
 
        def __init__(self, *args):
17
 
            pass
18
 
 
19
 
 
20
 
d = D()
21
 
a = A()
22
 
a.cycle = a
23
 
a.other = B()
24
 
del a
25
 
 
26
 
prev = None
27
 
while 1:
28
 
    d[5]
29
 
    prev = (prev,)