Bug 1455143 - Use .write() instead of print >>; r?Build
.write() is the preferred mechanism to write to a file object.
MozReview-Commit-ID: 1uhNeFayoxV
--- a/build/checksums.py
+++ b/build/checksums.py
@@ -62,19 +62,19 @@ def process_files(files, output_filename
for digest in digests:
hash = digest_file(file, digest)
if file.startswith(strip):
short_file = file[len(strip):]
short_file = short_file.lstrip('/')
else:
short_file = file
- print >>output, '%s %s %s %s' % (hash, digest,
- os.path.getsize(file),
- short_file)
+
+ output.write('%s %s %s %s\n' % (
+ hash, digest, os.path.getsize(file), short_file))
def setup_logging(level=logging.DEBUG):
'''This function sets up the logging module using a speficiable logging
module logging level. The default log level is DEBUG.
The output is in the format:
<level> - <message>