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

Side by Side Diff: third_party/google-endpoints/libfuturize/fixes/fix_remove_old__future__imports.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 """
2 Fixer for removing any of these lines:
3
4 from __future__ import with_statement
5 from __future__ import nested_scopes
6 from __future__ import generators
7
8 The reason is that __future__ imports like these are required to be the first
9 line of code (after docstrings) on Python 2.6+, which can get in the way.
10
11 These imports are always enabled in Python 2.6+, which is the minimum sane
12 version to target for Py2/3 compatibility.
13 """
14
15 from lib2to3 import fixer_base
16 from libfuturize.fixer_util import remove_future_import
17
18 class FixRemoveOldFutureImports(fixer_base.BaseFix):
19 BM_compatible = True
20 PATTERN = "file_input"
21 run_order = 1
22
23 def transform(self, node, results):
24 remove_future_import(u"with_statement", node)
25 remove_future_import(u"nested_scopes", node)
26 remove_future_import(u"generators", node)
27
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698