]> git.proxmox.com Git - mirror_edk2.git/blob - AppPkg/Applications/Python/Python-2.7.2/Lib/lib2to3/fixes/fix_buffer.py
EmbeddedPkg: Extend NvVarStoreFormattedLib LIBRARY_CLASS
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Lib / lib2to3 / fixes / fix_buffer.py
1 # Copyright 2007 Google, Inc. All Rights Reserved.
2 # Licensed to PSF under a Contributor Agreement.
3
4 """Fixer that changes buffer(...) into memoryview(...)."""
5
6 # Local imports
7 from .. import fixer_base
8 from ..fixer_util import Name
9
10
11 class FixBuffer(fixer_base.BaseFix):
12 BM_compatible = True
13
14 explicit = True # The user must ask for this fixer
15
16 PATTERN = """
17 power< name='buffer' trailer< '(' [any] ')' > any* >
18 """
19
20 def transform(self, node, results):
21 name = results["name"]
22 name.replace(Name(u"memoryview", prefix=name.prefix))