mozbuild: Encode content of GeneratedFile.

This commit is contained in:
Vincent Povirk 2019-08-22 13:04:06 -05:00 committed by Jacek Caban
parent 064852f9b3
commit a05b2fb551
2 changed files with 5 additions and 2 deletions

View File

@ -489,7 +489,10 @@ class GeneratedFile(BaseFile):
File class for content with no previous existence on the filesystem.
'''
def __init__(self, content):
self.content = content
if isinstance(content, str):
self.content = content.encode()
else:
self.content = content
def open(self, mode='rb'):
if 'b' in mode:

View File

@ -192,7 +192,7 @@ class RemovedFiles(GeneratedFile):
return
if self.copier.contains(f):
errors.error('Removal of packaged file(s): %s' % f)
self.content += f + '\n'
self.content += f.encode() + b'\n'
def split_define(define):