Skip to content

Commit 581e3ce

Browse files
authored
Merge pull request #362 from PythonCharmers/revert-344-fix-read-only
Revert "Fix `past.translation` on read-only file systems"
2 parents ab9acdb + 923d473 commit 581e3ce

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)
405407
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)