modernize some modules' code by replacing OSError->ENOENT/ENOTDIR/EPERM/EEXIST occurrences with the corresponding pep-3151 exceptions (FileNotFoundError, NotADirectoryError, etc.)

This commit is contained in:
Giampaolo Rodola' 2013-02-12 15:14:17 +01:00
parent b071d4f3da
commit 0166a283f6
6 changed files with 27 additions and 51 deletions

View file

@ -102,9 +102,8 @@ elif os.name == "posix":
finally:
try:
os.unlink(ccout)
except OSError as e:
if e.errno != errno.ENOENT:
raise
except FileNotFoundError:
pass
if rv == 10:
raise OSError('gcc or cc command not found')
res = re.search(expr, trace)