do some crazy stuff on exception msg when exception object does not have errno attribute

This commit is contained in:
Nikos Kouremenos 2005-12-26 01:05:36 +00:00
parent 9385f1074f
commit 8a875bdb2c
1 changed files with 5 additions and 2 deletions

View File

@ -43,8 +43,11 @@ def temp_failure_retry(func, *args, **kwargs):
try:
return func(*args, **kwargs)
except (os.error, IOError, select.error), ex:
print ex, dir(ex)
if ex.errno == errno.EINTR:
if hasattr(ex, 'errno'):
errnum = ex.errno
else:
errnum = int(str(ex)[0])
if errnum == errno.EINTR:
continue
else:
raise