[Python-checkins] r65588 - in python/trunk: Lib/socket.py Misc/NEWS
brett.cannon
python-checkins at python.org
Fri Aug 8 06:27:28 CEST 2008
Author: brett.cannon
Date: Fri Aug 8 06:27:28 2008
New Revision: 65588
Log:
Remove buffer() usage in the socket module by just slicing directly on the
object. This removes all warnings for the module caused by running under -3.
Modified:
python/trunk/Lib/socket.py
python/trunk/Misc/NEWS
Modified: python/trunk/Lib/socket.py
==============================================================================
--- python/trunk/Lib/socket.py (original)
+++ python/trunk/Lib/socket.py Fri Aug 8 06:27:28 2008
@@ -407,8 +407,8 @@
nl = data.find('\n')
if nl >= 0:
nl += 1
- buf.write(buffer(data, 0, nl))
- self._rbuf.write(buffer(data, nl))
+ buf.write(data[:nl])
+ self._rbuf.write(data[nl:])
del data
break
buf.write(data)
@@ -434,9 +434,9 @@
if nl >= 0:
nl += 1
# save the excess data to _rbuf
- self._rbuf.write(buffer(data, nl))
+ self._rbuf.write(data[nl:])
if buf_len:
- buf.write(buffer(data, 0, nl))
+ buf.write(data[:nl])
break
else:
# Shortcut. Avoid data copy through buf when returning
@@ -448,8 +448,8 @@
# returning exactly all of our first recv().
return data
if n >= left:
- buf.write(buffer(data, 0, left))
- self._rbuf.write(buffer(data, left))
+ buf.write(data[:left])
+ self._rbuf.write(data[left:])
break
buf.write(data)
buf_len += n
Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS (original)
+++ python/trunk/Misc/NEWS Fri Aug 8 06:27:28 2008
@@ -48,7 +48,7 @@
while running under the ``-3`` flag: aifc, asyncore, bdb, bsddb,
ConfigParser, cookielib, DocXMLRPCServer, email, filecmp, fileinput, inspect,
logging, modulefinder, pdb, pickle, profile, pstats, pydoc, re, rlcompleter,
- SimpleXMLRPCServer, shelve, subprocess, sqlite3, tarfile, Tkinter,
+ SimpleXMLRPCServer, shelve, socket, subprocess, sqlite3, tarfile, Tkinter,
test.test_support, textwrap, threading, tokenize, traceback, urlparse,
wsgiref, xml, xmlrpclib.
More information about the Python-checkins
mailing list