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

This commit is contained in:
David Wilson 2019-01-23 12:44:08 +00:00
parent 3afd667136
commit 07f1b9bdd0
2 changed files with 10 additions and 1 deletions

View File

@ -147,9 +147,12 @@ else:
AnyTextType = (BytesType, UnicodeType)
if sys.version_info < (2, 5):
try:
next
except NameError:
next = lambda it: it.next()
#: 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
#: value has many performance implications, 128KiB seems to be a sweet spot.

View File

@ -63,6 +63,12 @@ from mitogen.core import b
from mitogen.core import LOG
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)