summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-10-07 20:32:10 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-10-07 20:32:10 (GMT)
commitd78b9dcbc3356d15bd0d0dd9f821452b4f5ba282 (patch)
tree870da709d8f5f95efcd2c120563cb88b5606e3fd /Lib
parent39defbe6a9191d3054dca0903b4861f7adcfd68d (diff)
downloadcpython-d78b9dcbc3356d15bd0d0dd9f821452b4f5ba282.zip
cpython-d78b9dcbc3356d15bd0d0dd9f821452b4f5ba282.tar.gz
cpython-d78b9dcbc3356d15bd0d0dd9f821452b4f5ba282.tar.bz2
#4069: aSet.remove(otherSet) would always report the empty frozenset([]) as the missing key.
Now it correctly refers to the initial otherset. Reviewed by Raymond. Will backport to 2.6.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_set.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py
index 1b01954..499406f 100644
--- a/Lib/test/test_set.py
+++ b/Lib/test/test_set.py
@@ -382,6 +382,17 @@ class TestSet(TestJointOps):
else:
self.fail()
+ def test_remove_keyerror_set(self):
+ key = self.thetype([3, 4])
+ try:
+ self.s.remove(key)
+ except KeyError as e:
+ self.assert_(e.args[0] is key,
+ "KeyError should be {0}, not {1}".format(key,
+ e.args[0]))
+ else:
+ self.fail()
+
def test_discard(self):
self.s.discard('a')
self.assert_('a' not in self.s)