Use errno to test Broken pipe
The value could depend on the OS review10691002
This commit is contained in:
1 parent
cbcb1467da
commit
a2dec94faa
1 file changed
+3
-2
+3
-2
@@ -15,6 +15,7 @@ import StringIO
|
||||
import hashlib
|
||||
import base64
|
||||
import threading
|
||||
import errno
|
||||
from functools import partial
|
||||
from contextlib import contextmanager
|
||||
|
||||
@@ -263,8 +264,8 @@ class ServerProxy(xmlrpclib.ServerProxy):
|
||||
verbose=self.__verbose
|
||||
)
|
||||
except (socket.error, httplib.HTTPException), v:
|
||||
# trap 'Broken pipe'
|
||||
if isinstance(v, socket.error) and v.args[0] != 32:
|
||||
if (isinstance(v, socket.error)
|
||||
and v.args[0] == errno.EPIPE):
|
||||
raise
|
||||
# try one more time
|
||||
self.__transport.close()
|
||||
|
||||
Reference in new issue
Block a user