Closes SF bug #628246.

The _update method detected mutable elements by trapping TypeErrors.
Unfortunately, this masked useful TypeErrors raised by the iterable
itself.  For cases where it is possible for an iterable to raise
a TypeError, the iterable is pre-converted to a list outside the
try/except so that any TypeErrors propagate through.
This commit is contained in:
Raymond Hettinger 2002-11-08 05:03:21 +00:00
parent dde800ec4e
commit 1eb1fb814b
2 changed files with 27 additions and 0 deletions

View file

@ -320,6 +320,8 @@ class BaseSet(object):
return
value = True
if type(iterable) not in (list, tuple, dict, file, xrange, str):
iterable = list(iterable)
it = iter(iterable)
while True:
try: