Bug 1306214 part 1 - Make mach devtools-css-db windows-compatible. r=tromey
MozReview-Commit-ID: AmF1uAooikW
--- a/devtools/shared/css/generated/mach_commands.py
+++ b/devtools/shared/css/generated/mach_commands.py
@@ -107,18 +107,18 @@ class MachCommands(MachCommandBase):
def output_template(self, substitutions):
"""Output a the properties-db.js from a template."""
js_template_path = resolve_path(self.topsrcdir,
'devtools/shared/css/generated/properties-db.js.in')
destination_path = resolve_path(self.topsrcdir,
'devtools/shared/css/generated/properties-db.js')
- with open(js_template_path, 'r') as handle:
+ with open(js_template_path, 'rb') as handle:
js_template = handle.read()
preamble = '/* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT */\n\n'
contents = string.Template(js_template).substitute(substitutions)
- with open(destination_path, 'w') as destination:
+ with open(destination_path, 'wb') as destination:
destination.write(preamble + contents)
print('The database was successfully generated at ' + destination_path)