Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1259)

Unified Diff: scripts/auxiliar/fixcc.py

Issue 573340043: Run 2to3 --write --nobackups . (Closed)
Patch Set: Remove coverage.py Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « scripts/auxiliar/find-superfluous-includes.py ('k') | scripts/auxiliar/makelsr.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/auxiliar/fixcc.py
diff --git a/scripts/auxiliar/fixcc.py b/scripts/auxiliar/fixcc.py
index 06dcc71e2212f1d3e7a3a90535e5768148086a7f..2ad9a82cbf3d27768e23d7ea208fbda73be02c42 100755
--- a/scripts/auxiliar/fixcc.py
+++ b/scripts/auxiliar/fixcc.py
@@ -201,7 +201,7 @@ class Snippet (Chunk):
return self.match.group (s)
def __repr__ (self):
- return `self.__class__` + ' type = ' + self.type
+ return repr(self.__class__) + ' type = ' + self.type
class Multiline_comment (Snippet):
def __init__ (self, source, match, format):
@@ -241,8 +241,8 @@ def find_toplevel_snippets (s, types):
## types))
## urg python2.1
found = {}
- map (lambda x, f = found: f.setdefault (x, None),
- types)
+ list(map (lambda x, f = found: f.setdefault (x, None),
+ types))
# We want to search for multiple regexes, without searching
# the string multiple times for one regex.
@@ -264,7 +264,7 @@ def find_toplevel_snippets (s, types):
continue
cl = Snippet
- if snippet_type_to_class.has_key (type):
+ if type in snippet_type_to_class:
cl = snippet_type_to_class[type]
snip = cl (type, m, format)
start = index + m.start ('match')
@@ -322,7 +322,7 @@ def nitpick_file (outdir, file):
#code = filter (lambda x: is_derived_class (x.__class__, Substring),
# chunks)
- t = ''.join (map (lambda x: x.filter_text (), chunks))
+ t = ''.join ([x.filter_text () for x in chunks])
fixt = file
if s != t:
if not outdir:
@@ -418,10 +418,10 @@ socketname = 'fixcc%d' % os.getpid ()
def main ():
files = do_options ()
if not check_astyle_version():
- print "Warning: try to use %s." % PREFERRED_ASTYLE_VERSION
- print "Please limit use of this version to files with changed code."
+ print("Warning: try to use %s." % PREFERRED_ASTYLE_VERSION)
+ print("Please limit use of this version to files with changed code.")
if len(files) > 4:
- print "Too many files with this version. See `astyle --help`"
+ print("Too many files with this version. See `astyle --help`")
sys.exit(1)
if outdir and not os.path.isdir (outdir):
os.makedirs (outdir)
« no previous file with comments | « scripts/auxiliar/find-superfluous-includes.py ('k') | scripts/auxiliar/makelsr.py » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b