check so we cannot fail
This commit is contained in:
parent
67aa6460de
commit
250e916318
1 changed files with 4 additions and 2 deletions
|
@ -44,9 +44,11 @@ def temp_failure_retry(func, *args, **kwargs):
|
||||||
return func(*args, **kwargs)
|
return func(*args, **kwargs)
|
||||||
except (os.error, IOError, select.error), ex:
|
except (os.error, IOError, select.error), ex:
|
||||||
if hasattr(ex, 'errno'):
|
if hasattr(ex, 'errno'):
|
||||||
errnum = ex.errno
|
errnum = ex.errno
|
||||||
|
elif hasattr(ex, 'args') and len(ex.args) > 0:
|
||||||
|
errnum = ex.args[0]
|
||||||
else:
|
else:
|
||||||
errnum = ex.args[0]
|
errnum = -1
|
||||||
if errnum == errno.EINTR:
|
if errnum == errno.EINTR:
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Reference in a new issue