]>
git.proxmox.com Git - mirror_edk2.git/blob - AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/fixes/fix_funcattrs.py
1 """Fix function attribute names (f.func_x -> f.__x__)."""
2 # Author: Collin Winter
5 from .. import fixer_base
6 from ..fixer_util
import Name
9 class FixFuncattrs(fixer_base
.BaseFix
):
13 power< any+ trailer< '.' attr=('func_closure' | 'func_doc' | 'func_globals'
14 | 'func_name' | 'func_defaults' | 'func_code'
15 | 'func_dict') > any* >
18 def transform(self
, node
, results
):
19 attr
= results
["attr"][0]
20 attr
.replace(Name((u
"__%s__" % attr
.value
[5:]),