Change to the way the builtin next
is checked for, to avoid
confusing pyflakes/pylint.
This commit is contained in:
@@ -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.
|
||||||
"""
|
"""
|
||||||
|
Reference in New Issue
Block a user