Commit c0f672fe authored by Denis Bilenko's avatar Denis Bilenko

Pool: check argument passed in __init__

parent 46c9dd02
...@@ -164,6 +164,8 @@ class GreenletSet(object): ...@@ -164,6 +164,8 @@ class GreenletSet(object):
class Pool(GreenletSet): class Pool(GreenletSet):
def __init__(self, size=None): def __init__(self, size=None):
if size is not None and size < 0:
raise ValueError('Invalid size for pool (positive integer or None required): %r' % (size, ))
GreenletSet.__init__(self) GreenletSet.__init__(self)
self.size = size self.size = size
self.waiting = deque() self.waiting = deque()
......
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