                                         StackFrame: athurx+9f3bb
[2025-06-30 10:11:11.536] [info   ] [SDALib     ] [ 1860: 1908] [E1CABB: 156] [          SystemDumpAnalyzerModule::Scan] File :C:\Windows\Minidump\032918-78624-01.dmp, dump type: Kernel Mini
                                                                              OS Version: 6.1.7601 Service Pack 1
                                                                              Bucket ID: 
                                                                              -Modules-
                                                                              -StackTrace-
                                                                              StackFrame: athurx+8e26
                                                                              StackFrame: athurx+8dc5
                                                                              StackFrame: athurx+14c740
                                                                              StackFrame: athurx+14c6f0
[2025-06-30 10:11:12.036] [info   ] [SDALib     ] [ 1860: 1908] [E1CABB: 156] [          SystemDumpAnalyzerModule::Scan] File :C:\Windows\Minidump\042020-44694-01.dmp, dump type: Kernel Mini
                                                                              OS Version: 6.1.7601 Service Pack 1
                                                                              Bucket ID: 
                                                                              -Modules-
                                                                              -StackTrace-
                                                                              StackFrame: athurx+8e26
                                                                              StackFrame: athurx+8dc5
                                                                              StackFrame: athurx+14c740
                                                                              StackFrame: athurx+14c6f0
[2025-06-30 10:11:12.457] [info   ] [SDALib     ] [ 1860: 1908] [E1CABB: 156] [          SystemDumpAnalyzerModule::Scan] File :C:\Windows\Minidump\042520-37783-01.dmp, dump type: Kernel Mini
                                                                              OS Version: 6.1.7601 Service Pack 1
                                                                              Bucket ID: 
                                                                              -Modules-
                                                                              -StackTrace-
                                                                              StackFrame: athurx+8e26
                                                                              StackFrame: athurx+8dc5
                                                                              StackFrame: athurx+14c740
                                                                              StackFrame: athurx+14c6f0
[2025-06-30 10:11:12.660] [info   ] [SDALib     ] [ 1860: 1908] [E1CABB: 156] [          SystemDumpAnalyzerModule::Scan] File :C:\Windows\Minidump\050618-287478-01.dmp, dump type: Kernel Mini
                                                                              OS Version: 6.1.7601 Service Pack 1
                                                                              Bucket ID: 
                                                                              -Modules-
                                            """Fix bound method attributes (method.im_? -> method.__?__).
"""
# Author: Christian Heimes

# Local imports
from .. import fixer_base
from ..fixer_util import Name

MAP = {
    "im_func" : "__func__",
    "im_self" : "__self__",
    "im_class" : "__self__.__class__"
    }

class FixMethodattrs(fixer_base.BaseFix):
    BM_compatible = True
    PATTERN = """
    power< any+ trailer< '.' attr=('im_func' | 'im_self' | 'im_class') > any* >
    """

    def transform(self, node, results):
        attr = results["attr"][0]
        new = unicode(MAP[attr.value])
        attr.replace(Name(new, prefix=attr.prefix))
