summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_set.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-06-11 08:41:23 (GMT)
committerRaymond Hettinger <rhettinger@users.noreply.github.com>2019-06-11 08:41:23 (GMT)
commit583ff84351e528976aa93d383e5a81aee9f3bac3 (patch)
treeae0eeedeb0900f899444b251a9abd3b0a5fc74d4 /Lib/test/test_set.py
parentfe5f8b9ce2e504d4510cc82129d595015d239634 (diff)
downloadcpython-583ff84351e528976aa93d383e5a81aee9f3bac3.zip
cpython-583ff84351e528976aa93d383e5a81aee9f3bac3.tar.gz
cpython-583ff84351e528976aa93d383e5a81aee9f3bac3.tar.bz2
bpo-37219: Remove erroneous optimization for differencing an empty set (GH-13965) (GH-13967)
(cherry picked from commit 1f11cf9521114447b3e32e2ac88f075ffaa37555) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Diffstat (limited to 'Lib/test/test_set.py')
-rw-r--r--Lib/test/test_set.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py
index bb1081f..e4766ab 100644
--- a/Lib/test/test_set.py
+++ b/Lib/test/test_set.py
@@ -895,6 +895,12 @@ class TestBasicOps:
self.assertEqual(self.set, copy,
"%s != %s" % (self.set, copy))
+ def test_issue_37219(self):
+ with self.assertRaises(TypeError):
+ set().difference(123)
+ with self.assertRaises(TypeError):
+ set().difference_update(123)
+
#------------------------------------------------------------------------------
class TestBasicOpsEmpty(TestBasicOps, unittest.TestCase):