|
@@ -2,7 +2,7 @@
|
|
# User Ricky Stewart <rstewart@mozilla.com>
|
|
# User Ricky Stewart <rstewart@mozilla.com>
|
|
# Date 1582149050 0
|
|
# Date 1582149050 0
|
|
# Node ID 061442a5cbbf18e264ee4fef6739b0c302545915
|
|
# Node ID 061442a5cbbf18e264ee4fef6739b0c302545915
|
|
-# Parent 32a6e6a057ca67ca181be700168879eb8c535f7c
|
|
|
|
|
|
+# Parent 9e5a622ad2d4a21d43663c1fff4e7c20ee8bbf68
|
|
Bug 1613263 - Use io.open() rather than open() in mozbuild/preprocessor.py r=firefox-build-system-reviewers,mshal
|
|
Bug 1613263 - Use io.open() rather than open() in mozbuild/preprocessor.py r=firefox-build-system-reviewers,mshal
|
|
|
|
|
|
Differential Revision: https://phabricator.services.mozilla.com/D61647
|
|
Differential Revision: https://phabricator.services.mozilla.com/D61647
|
|
@@ -353,14 +353,14 @@ diff --git a/python/mozbuild/mozbuild/preprocessor.py b/python/mozbuild/mozbuild
|
|
+import sys
|
|
+import sys
|
|
+
|
|
+
|
|
from mozbuild.makeutil import Makefile
|
|
from mozbuild.makeutil import Makefile
|
|
- from mozpack.path import normsep
|
|
|
|
|
|
|
|
# hack around win32 mangling our line endings
|
|
# hack around win32 mangling our line endings
|
|
# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65443
|
|
# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65443
|
|
if sys.platform == "win32":
|
|
if sys.platform == "win32":
|
|
import msvcrt
|
|
import msvcrt
|
|
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
|
|
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
|
|
-@@ -488,17 +490,17 @@ class Preprocessor:
|
|
|
|
|
|
+ os.linesep = '\n'
|
|
|
|
+@@ -487,17 +489,17 @@ class Preprocessor:
|
|
def get_output_file(path):
|
|
def get_output_file(path):
|
|
dir = os.path.dirname(path)
|
|
dir = os.path.dirname(path)
|
|
if dir:
|
|
if dir:
|
|
@@ -379,7 +379,7 @@ diff --git a/python/mozbuild/mozbuild/preprocessor.py b/python/mozbuild/mozbuild
|
|
|
|
|
|
if options.output:
|
|
if options.output:
|
|
out = get_output_file(options.output)
|
|
out = get_output_file(options.output)
|
|
-@@ -510,17 +512,17 @@ class Preprocessor:
|
|
|
|
|
|
+@@ -509,17 +511,17 @@ class Preprocessor:
|
|
if options.depend:
|
|
if options.depend:
|
|
if not options.output:
|
|
if not options.output:
|
|
raise Preprocessor.Error(self, "--depend doesn't work with stdout",
|
|
raise Preprocessor.Error(self, "--depend doesn't work with stdout",
|
|
@@ -398,7 +398,7 @@ diff --git a/python/mozbuild/mozbuild/preprocessor.py b/python/mozbuild/mozbuild
|
|
).add_dependencies(self.includes)
|
|
).add_dependencies(self.includes)
|
|
mk.dump(depfile)
|
|
mk.dump(depfile)
|
|
depfile.close()
|
|
depfile.close()
|
|
-@@ -800,17 +802,17 @@ class Preprocessor:
|
|
|
|
|
|
+@@ -799,17 +801,17 @@ class Preprocessor:
|
|
self.checkLineNumbers = False
|
|
self.checkLineNumbers = False
|
|
if isName:
|
|
if isName:
|
|
try:
|
|
try:
|
|
@@ -417,7 +417,7 @@ diff --git a/python/mozbuild/mozbuild/preprocessor.py b/python/mozbuild/mozbuild
|
|
oldFile = self.context['FILE']
|
|
oldFile = self.context['FILE']
|
|
oldLine = self.context['LINE']
|
|
oldLine = self.context['LINE']
|
|
oldDir = self.context['DIRECTORY']
|
|
oldDir = self.context['DIRECTORY']
|
|
-@@ -855,17 +857,17 @@ class Preprocessor:
|
|
|
|
|
|
+@@ -854,17 +856,17 @@ class Preprocessor:
|
|
|
|
|
|
|
|
|
|
def preprocess(includes=[sys.stdin], defines={},
|
|
def preprocess(includes=[sys.stdin], defines={},
|
|
@@ -439,14 +439,14 @@ diff --git a/python/mozbuild/mozbuild/preprocessor.py b/python/mozbuild/mozbuild
|
|
diff --git a/python/mozbuild/mozbuild/test/backend/test_build.py b/python/mozbuild/mozbuild/test/backend/test_build.py
|
|
diff --git a/python/mozbuild/mozbuild/test/backend/test_build.py b/python/mozbuild/mozbuild/test/backend/test_build.py
|
|
--- a/python/mozbuild/mozbuild/test/backend/test_build.py
|
|
--- a/python/mozbuild/mozbuild/test/backend/test_build.py
|
|
+++ b/python/mozbuild/mozbuild/test/backend/test_build.py
|
|
+++ b/python/mozbuild/mozbuild/test/backend/test_build.py
|
|
-@@ -145,21 +145,18 @@ class TestBuild(unittest.TestCase):
|
|
|
|
|
|
+@@ -146,21 +146,18 @@ class TestBuild(unittest.TestCase):
|
|
|
|
|
|
self.validate(config)
|
|
self.validate(config)
|
|
|
|
|
|
def validate(self, config):
|
|
def validate(self, config):
|
|
self.maxDiff = None
|
|
self.maxDiff = None
|
|
- test_path = mozpath.join('$SRCDIR', 'python', 'mozbuild', 'mozbuild',
|
|
|
|
- 'test', 'backend', 'data', 'build')
|
|
|
|
|
|
+ test_path = os.sep.join(('$SRCDIR', 'python', 'mozbuild', 'mozbuild',
|
|
|
|
+ 'test', 'backend', 'data', 'build')) + os.sep
|
|
|
|
|
|
- # We want unicode instances out of the files, because having plain str
|
|
- # We want unicode instances out of the files, because having plain str
|
|
- # makes assertEqual diff output in case of error extra verbose because
|
|
- # makes assertEqual diff output in case of error extra verbose because
|