Do not re-raise the exception if the one that we are checking
@@ -222,8 +222,7 @@ def safe_makedirs(directory_name):
try:
os.makedirs(directory_name)
except OSError as e:
- if e.errno == errno.EEXIST:
- pass
+ if e.errno != errno.EEXIST: # 17, FileExistsError
raise
