diff options
| author | Ezio Melotti <ezio.melotti@gmail.com> | 2010-08-03 03:19:00 (GMT) |
|---|---|---|
| committer | Ezio Melotti <ezio.melotti@gmail.com> | 2010-08-03 03:19:00 (GMT) |
| commit | 262a47d2b987f8ce88964a6383576c4f5be8e79b (patch) | |
| tree | 8661e6f62b93dc7ac0c22150b732d6b70bae1c17 /Lib/socket.py | |
| parent | efcdd8494a13a40e9f0defd8285810524856bae1 (diff) | |
| download | cpython-262a47d2b987f8ce88964a6383576c4f5be8e79b.zip cpython-262a47d2b987f8ce88964a6383576c4f5be8e79b.tar.gz cpython-262a47d2b987f8ce88964a6383576c4f5be8e79b.tar.bz2 | |
Merged revisions 75407,75409-75413,75415,75419-75421 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r75407 | antoine.pitrou | 2009-10-14 20:30:52 +0300 (Wed, 14 Oct 2009) | 3 lines
Fix py3k warnings in the aifc module
........
r75409 | antoine.pitrou | 2009-10-14 21:01:33 +0300 (Wed, 14 Oct 2009) | 3 lines
Fix py3k warnings in bsddb
........
r75410 | antoine.pitrou | 2009-10-14 21:09:45 +0300 (Wed, 14 Oct 2009) | 3 lines
Silence a py3k warning claiming to affect Lib/calendar.py
........
r75411 | antoine.pitrou | 2009-10-14 21:12:54 +0300 (Wed, 14 Oct 2009) | 3 lines
Fix a py3k warning in the StringIO module (exhibited in test_codecencodings_cn)
........
r75412 | antoine.pitrou | 2009-10-14 21:27:32 +0300 (Wed, 14 Oct 2009) | 3 lines
Fix py3k warnings in the socket module
........
r75413 | antoine.pitrou | 2009-10-14 21:31:05 +0300 (Wed, 14 Oct 2009) | 3 lines
Fix a py3k warning in the sndhdr module (found with test_email)
........
r75415 | antoine.pitrou | 2009-10-14 21:39:46 +0300 (Wed, 14 Oct 2009) | 3 lines
Silence some py3k warnings claiming to affect _pyio
........
r75419 | antoine.pitrou | 2009-10-14 21:56:11 +0300 (Wed, 14 Oct 2009) | 3 lines
Silence py3k warning claiming to affect the random module
........
r75420 | antoine.pitrou | 2009-10-14 22:04:48 +0300 (Wed, 14 Oct 2009) | 3 lines
Fix py3k warnings in httplib
........
r75421 | antoine.pitrou | 2009-10-14 22:09:48 +0300 (Wed, 14 Oct 2009) | 3 lines
Fix py3k warnings in the uuid module
........
Diffstat (limited to 'Lib/socket.py')
| -rw-r--r-- | Lib/socket.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Lib/socket.py b/Lib/socket.py index 98ab2dc..226eeeb 100644 --- a/Lib/socket.py +++ b/Lib/socket.py @@ -290,12 +290,16 @@ class _fileobject(object): write_offset = 0 try: while write_offset < data_size: - self._sock.sendall(buffer(data, write_offset, buffer_size)) + with warnings.catch_warnings(): + if sys.py3kwarning: + warnings.filterwarnings("ignore", ".*buffer", + DeprecationWarning) + self._sock.sendall(buffer(data, write_offset, buffer_size)) write_offset += buffer_size finally: if write_offset < data_size: remainder = data[write_offset:] - del data # explicit free + del view, data # explicit free self._wbuf.append(remainder) self._wbuf_len = len(remainder) @@ -343,7 +347,7 @@ class _fileobject(object): try: data = self._sock.recv(rbufsize) except error, e: - if e[0] == EINTR: + if e.args[0] == EINTR: continue raise if not data: @@ -372,7 +376,7 @@ class _fileobject(object): try: data = self._sock.recv(left) except error, e: - if e[0] == EINTR: + if e.args[0] == EINTR: continue raise if not data: @@ -427,7 +431,7 @@ class _fileobject(object): except error, e: # The try..except to catch EINTR was moved outside the # recv loop to avoid the per byte overhead. - if e[0] == EINTR: + if e.args[0] == EINTR: continue raise break @@ -439,7 +443,7 @@ class _fileobject(object): try: data = self._sock.recv(self._rbufsize) except error, e: - if e[0] == EINTR: + if e.args[0] == EINTR: continue raise if not data: @@ -468,7 +472,7 @@ class _fileobject(object): try: data = self._sock.recv(self._rbufsize) except error, e: - if e[0] == EINTR: + if e.args[0] == EINTR: continue raise if not data: |
