Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: third_party/google-endpoints/libpasteurize/fixes/fix_memoryview.py

Issue 2666783008: Add google-endpoints to third_party/. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 u"""
2 Fixer for memoryview(s) -> buffer(s).
3 Explicit because some memoryview methods are invalid on buffer objects.
4 """
5
6 from lib2to3 import fixer_base
7 from lib2to3.fixer_util import Name
8
9
10 class FixMemoryview(fixer_base.BaseFix):
11
12 explicit = True # User must specify that they want this.
13
14 PATTERN = u"""
15 power< name='memoryview' trailer< '(' [any] ')' >
16 rest=any* >
17 """
18
19 def transform(self, node, results):
20 name = results[u"name"]
21 name.replace(Name(u"buffer", prefix=name.prefix))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698