git: 9front

ref: 4bb9e229bcb23826a0fde907667c8fd6565d98d2
dir: /sys/lib/python/test/crashers/dangerous_subclassing.py/

View raw version

# 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