Bug 1436792 - [py-compat] Fix issue opening the temporary manifest on Windows, r?jmaher draft
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Thu, 08 Feb 2018 14:26:27 -0500
changeset 752684 0e5c2ed9a158be3fa75ac3d96aea8511c1791c0d
parent 752683 2ed522e1d99148a5a041b5c9893d1a3452d45ae7
push id98346
push userahalberstadt@mozilla.com
push dateThu, 08 Feb 2018 19:56:40 +0000
reviewersjmaher
bugs1436792
milestone60.0a1
Bug 1436792 - [py-compat] Fix issue opening the temporary manifest on Windows, r?jmaher MozReview-Commit-ID: FmA1K8osuqe
tools/lint/python/compat.py
--- a/tools/lint/python/compat.py
+++ b/tools/lint/python/compat.py
@@ -1,19 +1,19 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 from __future__ import absolute_import, print_function
 
 import json
 import os
-import tempfile
 from distutils.spawn import find_executable
 
+import mozfile
 import mozpack.path as mozpath
 from mozpack.files import FileFinder
 from mozprocess import ProcessHandlerMixin
 
 from mozlint import result
 
 here = os.path.abspath(os.path.dirname(__file__))
 
@@ -66,17 +66,17 @@ def run_linter(python, paths, config, **
             files.append(path)
             continue
 
         ignore = [e[len(path):].lstrip('/') for e in exclude
                   if mozpath.commonprefix((path, e)) == path]
         finder = FileFinder(path, ignore=ignore)
         files.extend([os.path.join(path, p) for p, f in finder.find(pattern)])
 
-    with tempfile.NamedTemporaryFile(mode='w') as fh:
+    with mozfile.NamedTemporaryFile(mode='w') as fh:
         fh.write('\n'.join(files))
         fh.flush()
 
         cmd = [binary, os.path.join(here, 'check_compat.py'), fh.name]
 
         proc = PyCompatProcess(config, cmd)
         proc.run()
         try: