/usr/lib/python2.7/dist-packages/libpasteurize/fixes/fix_memoryview.py is in python-future 0.15.2-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | u"""
Fixer for memoryview(s) -> buffer(s).
Explicit because some memoryview methods are invalid on buffer objects.
"""
from lib2to3 import fixer_base
from lib2to3.fixer_util import Name
class FixMemoryview(fixer_base.BaseFix):
explicit = True # User must specify that they want this.
PATTERN = u"""
power< name='memoryview' trailer< '(' [any] ')' >
rest=any* >
"""
def transform(self, node, results):
name = results[u"name"]
name.replace(Name(u"buffer", prefix=name.prefix))
|