Merge pull request #173 from edbrannin/use-contrib-makedirs

Use contrib.makedirs instead of os.makedirs in cache.py
This commit is contained in:
Jack O'Connor 2017-03-10 16:30:54 -05:00 committed by GitHub
commit a05629d0ed
1 changed files with 2 additions and 3 deletions

View File

@ -267,7 +267,7 @@ class _Cache:
@asyncio.coroutine
def _init_trees(self):
if not os.path.exists(os.path.join(self.trees_path, 'HEAD')):
os.makedirs(self.trees_path)
makedirs(self.trees_path)
with self.clean_git_session() as session:
yield from session.init_git_dir()
# Override any .gitattributes files that might be in the sync dir,
@ -358,8 +358,7 @@ class _Cache:
tree = tree or (yield from self.get_empty_tree())
previous_tree = previous_tree or (yield from self.get_empty_tree())
if not os.path.exists(dest):
os.makedirs(dest)
makedirs(dest)
with contextlib.ExitStack() as stack: