Commit 5ebc4061 authored by Jason Madden's avatar Jason Madden

Use the old default read size for python < 2.7.12

Also install 2.7.12 on travis.
parent 60f9ce11
......@@ -85,7 +85,7 @@ for var in "$@"; do
install 2.7.8 python2.7.8
;;
2.7)
install 2.7.11 python2.7
install 2.7.12 python2.7
;;
3.2)
install 3.2.6 python3.2
......
......@@ -164,6 +164,9 @@ _create_default_https_context = create_default_context
# Backwards compatibility alias, even though it's not a public name.
_create_stdlib_context = _create_unverified_context
import sys
# This changed with the fix for python bug #23804
_DEFAULT_READ_LEN = 0 if sys.version_info[:3] < (2, 7, 12) else 1024
class SSLSocket(socket):
"""
......@@ -296,7 +299,7 @@ class SSLSocket(socket):
# EAGAIN.
self.getpeername()
def read(self, len=1024, buffer=None):
def read(self, len=_DEFAULT_READ_LEN, buffer=None):
"""Read up to LEN bytes and return them.
Return zero-length string on EOF."""
self._checkClosed()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment