catch correct exception when interrupt system call
This commit is contained in:
parent
4fdd42e3e4
commit
993c09ec70
2 changed files with 2 additions and 2 deletions
|
@ -138,7 +138,7 @@ def temp_failure_retry(func, *args, **kwargs):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
return func(*args, **kwargs)
|
return func(*args, **kwargs)
|
||||||
except (os.error, IOError, socket.error), ex:
|
except (os.error, IOError, select.error), ex:
|
||||||
if ex.errno == errno.EINTR:
|
if ex.errno == errno.EINTR:
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -42,7 +42,7 @@ def temp_failure_retry(func, *args, **kwargs):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
return func(*args, **kwargs)
|
return func(*args, **kwargs)
|
||||||
except (os.error, IOError, socket.error), ex:
|
except (os.error, IOError, select.error), ex:
|
||||||
if ex.errno == errno.EINTR:
|
if ex.errno == errno.EINTR:
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Reference in a new issue