Skip to content
Snippets Groups Projects
Commit 4554e2e9 authored by Manuel Jacob's avatar Manuel Jacob
Browse files

tests: assume that `raw` attribute is present on original socket file object

It seems like the original socket file object is always an io.BufferedIO
instance. If not, the code will fail and we should try harder to get the socket
object (e.g. if the original socket file object is unbuffered, we can get the
`_sock` attribute directly from it).
parent 425ca342
No related branches found
No related tags found
2 merge requests!168branching: merge default into stable,!158Python 3 cleanups (part 2)
......@@ -335,12 +335,7 @@
def _close(self):
# We wrap an io.BufferedIO instance.
orig = object.__getattribute__(self, '_orig')
if hasattr(orig, 'raw'):
orig.raw._sock.shutdown(socket.SHUT_RDWR)
else:
self.close()
self.raw._sock.shutdown(socket.SHUT_RDWR)
def read(self, size=-1):
cond = object.__getattribute__(self, '_cond')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment