# HG changeset patch # User Andrew Halberstadt # Date 1518117987 18000 # Node ID 4b66e3729eda8249fd5ef1f69bae6c3f9ca8486f # Parent 928cb57e695a0b1a9c4b00084af1929592833c4b Bug 1436792 - [py-compat] Fix issue opening the temporary manifest on Windows, r=jmaher MozReview-Commit-ID: FmA1K8osuqe diff --git a/tools/lint/python/compat.py b/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: