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

Unified Diff: PRESUBMIT.py

Issue 118484: Use input_api.ReadFile() instead of rolling out its own. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | PRESUBMIT_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PRESUBMIT.py
===================================================================
--- PRESUBMIT.py (revision 18008)
+++ PRESUBMIT.py (working copy)
@@ -24,19 +24,7 @@
r"v8[\\\/].*",
]
-def ReadFile(path):
- """Given a path, returns the full contents of the file.
- Reads files in binary format.
- """
- fo = open(path, 'rb')
- try:
- contents = fo.read()
- finally:
- fo.close()
- return contents
-
-
def CheckChangeOnUpload(input_api, output_api):
# TODO(maruel): max_cols is temporarily disabled. Reenable once the source
# tree is in better shape.
@@ -100,7 +88,7 @@
# Need to read the file ourselves since AffectedFile.NewContents()
# will normalize line endings.
- contents = ReadFile(f.AbsoluteLocalPath())
+ contents = input_api.ReadFile(f)
if '\r' in contents:
cr_files.append(path)
« no previous file with comments | « no previous file | PRESUBMIT_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698