do some crazy stuff on exception msg when exception object does not have errno attribute
This commit is contained in:
parent
9385f1074f
commit
8a875bdb2c
|
@ -43,8 +43,11 @@ def temp_failure_retry(func, *args, **kwargs):
|
||||||
try:
|
try:
|
||||||
return func(*args, **kwargs)
|
return func(*args, **kwargs)
|
||||||
except (os.error, IOError, select.error), ex:
|
except (os.error, IOError, select.error), ex:
|
||||||
print ex, dir(ex)
|
if hasattr(ex, 'errno'):
|
||||||
if ex.errno == errno.EINTR:
|
errnum = ex.errno
|
||||||
|
else:
|
||||||
|
errnum = int(str(ex)[0])
|
||||||
|
if errnum == errno.EINTR:
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
|
Loading…
Reference in New Issue