Merged revisions 75134 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r75134 | antoine.pitrou | 2009-09-29 19:48:18 +0200 (mar., 29 sept. 2009) | 4 lines

  Issue #6790: Make it possible again to pass an `array.array` to
  `httplib.HTTPConnection.send`. Patch by Kirk McDonald.
........
This commit is contained in:
Antoine Pitrou 2009-09-29 18:14:09 +00:00
parent d08417182f
commit 530e1aca05
4 changed files with 22 additions and 2 deletions

View file

@ -66,6 +66,7 @@ Req-started-unread-response _CS_REQ_STARTED <response_class>
Req-sent-unread-response _CS_REQ_SENT <response_class>
"""
from array import array
import socket
from sys import py3kwarning
from urlparse import urlsplit
@ -732,7 +733,7 @@ class HTTPConnection:
print "send:", repr(str)
try:
blocksize=8192
if hasattr(str,'read') :
if hasattr(str,'read') and not isinstance(str, array):
if self.debuglevel > 0: print "sendIng a read()able"
data=str.read(blocksize)
while data: