зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1236111 - part 2: fix mozbuild to use the file mode modifiers specified for opening when writing a FileAvoidWrite, r=gps,nalexander
--HG-- extra : commitid : J6mVFwKgMQh extra : rebase_source : 8a8b0ba2c21cf561af8dd667e387106869a65124
This commit is contained in:
Родитель
7e16352e77
Коммит
fbc8f9a32e
|
@ -166,7 +166,12 @@ class FileAvoidWrite(BytesIO):
|
|||
existing.close()
|
||||
|
||||
ensureParentDir(self.name)
|
||||
with open(self.name, 'w') as file:
|
||||
# Maintain 'b' if specified. 'U' only applies to modes starting with
|
||||
# 'r', so it is dropped.
|
||||
writemode = 'w'
|
||||
if 'b' in self.mode:
|
||||
writemode += 'b'
|
||||
with open(self.name, writemode) as file:
|
||||
file.write(buf)
|
||||
|
||||
if self._capture_diff:
|
||||
|
|
Загрузка…
Ссылка в новой задаче