Make error handling around already existing directories more precise (#71)

This commit is contained in:
Alex Gaynor 2016-11-04 11:04:36 -04:00 committed by Mike Aizatsky
parent 38f4df7ddc
commit 4a03707c3e
1 changed files with 4 additions and 1 deletions

View File

@ -17,6 +17,7 @@
from __future__ import print_function
import argparse
import errno
import os
import pipes
import re
@ -236,7 +237,9 @@ def generate(generate_args):
try:
os.mkdir(dir)
except OSError:
except OSError as e:
if e.errno != errno.EEXIST:
raise
print(dir, 'already exists.', file=sys.stderr)
return 1