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

Side by Side Diff: test/rules-rebuild/src/make-sources.py

Issue 1454433002: Python 3 compatibility Base URL: https://chromium.googlesource.com/external/gyp.git@master
Patch Set: Rebase with master (4ec6c4e3a94bd04a6da2858163d40b2429b8aad1) Created 4 years, 8 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
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2011 Google Inc. All rights reserved. 2 # Copyright (c) 2011 Google Inc. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import sys 6 import sys
7 7
8 assert len(sys.argv) == 4, sys.argv 8 assert len(sys.argv) == 4, sys.argv
9 9
10 (in_file, c_file, h_file) = sys.argv[1:] 10 (in_file, c_file, h_file) = sys.argv[1:]
11 11
12 def write_file(filename, contents): 12 def write_file(filename, contents):
13 open(filename, 'wb').write(contents) 13 open(filename, 'w').write(contents)
14 14
15 write_file(c_file, open(in_file, 'rb').read()) 15 write_file(c_file, open(in_file, 'r').read())
16 16
17 write_file(h_file, '#define NAME "%s"\n' % in_file) 17 write_file(h_file, '#define NAME "%s"\n' % in_file)
18 18
19 sys.exit(0) 19 sys.exit(0)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698