mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 859349 - Saving .mozbuild/warnings.json fails if .mozbuild doesn't exist [r=gps]
This commit is contained in:
parent
89cb954609
commit
91c4b690de
@ -6,6 +6,7 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import errno
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
@ -265,6 +266,12 @@ class WarningsDatabase(object):
|
||||
|
||||
def save_to_file(self, filename):
|
||||
"""Save the database to a file."""
|
||||
try:
|
||||
# Ensure the directory exists
|
||||
os.makedirs(os.path.dirname(filename))
|
||||
except OSError as e:
|
||||
if e.errno != errno.EEXIST:
|
||||
raise
|
||||
with open(filename, 'wb') as fh:
|
||||
self.serialize(fh)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user