Commit 1c5fb3c2 authored by Tres Seaver's avatar Tres Seaver

Don't mask the 'set' builtin.

parent 7408ed7a
...@@ -147,20 +147,20 @@ class _BucketBase(_Base): ...@@ -147,20 +147,20 @@ class _BucketBase(_Base):
class _SetIteration(object): class _SetIteration(object):
def __init__(self, set, useValues=False, default=None): def __init__(self, to_iterate, useValues=False, default=None):
if set is None: if to_iterate is None:
set = () to_iterate = ()
self.set = set self.to_iterate = to_iterate
if useValues: if useValues:
try: try:
itmeth = set.iteritems itmeth = to_iterate.iteritems
except AttributeError: except AttributeError:
itmeth = set.__iter__ itmeth = to_iterate.__iter__
useValues = False useValues = False
else: else:
self.value = None self.value = None
else: else:
itmeth = set.__iter__ itmeth = to_iterate.__iter__
self.useValues = useValues self.useValues = useValues
self._next = itmeth().next self._next = itmeth().next
......
...@@ -14,6 +14,13 @@ ...@@ -14,6 +14,13 @@
import unittest import unittest
def _assertRaises(self, e_type, checked, *args, **kw):
try:
checked(*args, **kw)
except e_type as e:
return e
self.fail("Didn't raise: %s" % e_type.__name__)
class Test_BucketBase(unittest.TestCase): class Test_BucketBase(unittest.TestCase):
......
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