summaryrefslogtreecommitdiffstats
path: root/Lib/sets.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2002-11-08 05:03:21 (GMT)
committerRaymond Hettinger <python@rcn.com>2002-11-08 05:03:21 (GMT)
commit1eb1fb814b4d5ea12dcffd18bb132a1313a48ccf (patch)
tree896d6c9b5f20d362f784cb2ea59ad74d08ffe017 /Lib/sets.py
parentdde800ec4ee704d0c4d6d0b60d74e72e0ea834d8 (diff)
downloadcpython-1eb1fb814b4d5ea12dcffd18bb132a1313a48ccf.zip
cpython-1eb1fb814b4d5ea12dcffd18bb132a1313a48ccf.tar.gz
cpython-1eb1fb814b4d5ea12dcffd18bb132a1313a48ccf.tar.bz2
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.
Diffstat (limited to 'Lib/sets.py')
-rw-r--r--Lib/sets.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/sets.py b/Lib/sets.py
index 5f0f0a2..bbb93a0 100644
--- a/Lib/sets.py
+++ b/Lib/sets.py
@@ -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: