Bug 1455143 - Use .write() instead of print >>; r?Build draft
authorGregory Szorc <gps@mozilla.com>
Wed, 18 Apr 2018 15:39:26 -0700
changeset 785303 2f6c2a920ffde243b84b57b6ec8eed8be12362e4
parent 785302 9d6153d219fa39b3c9590dd9c86819d717adb6a1
child 785304 61f5322553405523028e09fbd8b48c826208e4da
push id107184
push userbmo:gps@mozilla.com
push dateThu, 19 Apr 2018 21:22:59 +0000
reviewersBuild
bugs1455143
milestone61.0a1
Bug 1455143 - Use .write() instead of print >>; r?Build .write() is the preferred mechanism to write to a file object. MozReview-Commit-ID: 1uhNeFayoxV
build/checksums.py
--- 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>