summaryrefslogtreecommitdiffstats
path: root/Lib/test/crashers/dangerous_subclassing.py
blob: 0479952b2ca44dddaf54eafc5dfb5cddb5a2392d (plain)
1
2
3
4
5
6
7
8
9
10
11
12

# http://python.org/sf/1174712

import types

class X(types.ModuleType, str):
    """Such a subclassing is incorrectly allowed --
    see the SF bug report for explanations"""

if __name__ == '__main__':
    X('name')    # segfault: ModuleType.__init__() reads
                 # the dict at the wrong offset