Skip to content

Commit 7cf0f9d

Browse files
authored
os.makedirs can fail
1 parent 8d5d809 commit 7cf0f9d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/past/translation/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,9 @@ def load_module(self, fullname):
402402
code = compile(source, self.pathname, 'exec')
403403

404404
dirname = os.path.dirname(cachename)
405-
if not os.path.exists(dirname):
406-
os.makedirs(dirname)
407405
try:
406+
if not os.path.exists(dirname):
407+
os.makedirs(dirname)
408408
with open(cachename, 'wb') as f:
409409
data = marshal.dumps(code)
410410
f.write(data)

0 commit comments

Comments
 (0)