Makedirs only throws oserror, so only catch that

The docs state this only throws OSError so we might
as well just catch only that vs its parent class.

Change-Id: I829996caf7ff256ff4949b8e1e0f27e233bab467
This commit is contained in:
Joshua Harlow 2016-08-13 20:21:14 -07:00
parent 115a39a3cf
commit 18e31db320
1 changed files with 1 additions and 1 deletions

View File

@ -146,7 +146,7 @@ def ensure_tree(path):
"""
try:
os.makedirs(path)
except EnvironmentError as e:
except OSError as e:
if e.errno != errno.EEXIST or not os.path.isdir(path):
raise
return False