Make dir if it does not exist

This commit is contained in:
Kovid Goyal 2020-07-31 22:05:24 +05:30
parent 5afeace988
commit 0137c2a74b
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -113,6 +113,10 @@ class POT(Command): # {{{
ans.append('')
pot = self.pot_header() + '\n\n' + '\n'.join(ans)
dest = self.j(self.TRANSLATIONS, 'iso_639', 'iso_639_3.pot')
try:
os.makedirs(os.path.dirname(dest))
except OSError:
pass
with open(dest, 'wb') as f:
f.write(pot.encode('utf-8'))
self.upload_pot(resource='iso639')