issue #477: Python 2.5 needs next() polyfill too.

issue510
David Wilson 6 years ago
parent 3afd667136
commit 07f1b9bdd0

@ -147,9 +147,12 @@ else:
AnyTextType = (BytesType, UnicodeType) AnyTextType = (BytesType, UnicodeType)
if sys.version_info < (2, 5): try:
next
except NameError:
next = lambda it: it.next() next = lambda it: it.next()
#: Default size for calls to :meth:`Side.read` or :meth:`Side.write`, and the #: Default size for calls to :meth:`Side.read` or :meth:`Side.write`, and the
#: size of buffers configured by :func:`mitogen.parent.create_socketpair`. This #: size of buffers configured by :func:`mitogen.parent.create_socketpair`. This
#: value has many performance implications, 128KiB seems to be a sweet spot. #: value has many performance implications, 128KiB seems to be a sweet spot.

@ -63,6 +63,12 @@ from mitogen.core import b
from mitogen.core import LOG from mitogen.core import LOG
from mitogen.core import IOLOG from mitogen.core import IOLOG
try:
next
except NameError:
# Python 2.4/2.5
from mitogen.core import next
itervalues = getattr(dict, 'itervalues', dict.values) itervalues = getattr(dict, 'itervalues', dict.values)

Loading…
Cancel
Save