]> git.proxmox.com Git - mirror_edk2.git/blame - AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/fixes/fix_funcattrs.py
EmbeddedPkg: Extend NvVarStoreFormattedLib LIBRARY_CLASS
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Lib / lib2to3 / fixes / fix_funcattrs.py
CommitLineData
4710c53d 1"""Fix function attribute names (f.func_x -> f.__x__)."""\r
2# Author: Collin Winter\r
3\r
4# Local imports\r
5from .. import fixer_base\r
6from ..fixer_util import Name\r
7\r
8\r
9class FixFuncattrs(fixer_base.BaseFix):\r
10 BM_compatible = True\r
11\r
12 PATTERN = """\r
13 power< any+ trailer< '.' attr=('func_closure' | 'func_doc' | 'func_globals'\r
14 | 'func_name' | 'func_defaults' | 'func_code'\r
15 | 'func_dict') > any* >\r
16 """\r
17\r
18 def transform(self, node, results):\r
19 attr = results["attr"][0]\r
20 attr.replace(Name((u"__%s__" % attr.value[5:]),\r
21 prefix=attr.prefix))\r