Change to the way the builtin next is checked for, to avoid

confusing pyflakes/pylint.
This commit is contained in:
Tavis Rudd
2010-02-27 01:36:38 -05:00
parent 6d6a2882af
commit f726858124

View File

@@ -1,5 +1,12 @@
import itertools import itertools
import traceback import traceback
import __builtin__
if not hasattr(__builtin__, 'next'):
def next(it):
try:
return it.next()
except AttributeError:
raise TypeError("%s object is not an iterator" % type(it))
from eventlet import event from eventlet import event
from eventlet import greenthread from eventlet import greenthread
@@ -11,15 +18,6 @@ __all__ = ['GreenPool', 'GreenPile']
DEBUG = False DEBUG = False
try:
next
except NameError:
def next(it):
try:
return it.next()
except AttributeError:
raise TypeError("%s object is not an iterator" % type(it))
class GreenPool(object): class GreenPool(object):
"""The GreenPool class is a pool of green threads. """The GreenPool class is a pool of green threads.
""" """