summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_selectors.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-01-13 08:58:33 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-01-13 08:58:33 (GMT)
commit38dc250521d2c34f58537b25301a0ac9a4bb6c85 (patch)
tree22510baff7fcfa37789fd564bf859b9cec3129ef /Lib/test/test_selectors.py
parentd9fe22ce9b7d351193bef274eaad0e7b43cbb903 (diff)
downloadcpython-38dc250521d2c34f58537b25301a0ac9a4bb6c85.zip
cpython-38dc250521d2c34f58537b25301a0ac9a4bb6c85.tar.gz
cpython-38dc250521d2c34f58537b25301a0ac9a4bb6c85.tar.bz2
Issue #23209, #23225: selectors.BaseSelector.close() now clears its internal
reference to the selector mapping to break a reference cycle. Initial patch written by Martin Richard.
Diffstat (limited to 'Lib/test/test_selectors.py')
-rw-r--r--Lib/test/test_selectors.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_selectors.py b/Lib/test/test_selectors.py
index f9aac50..dd30d44 100644
--- a/Lib/test/test_selectors.py
+++ b/Lib/test/test_selectors.py
@@ -180,6 +180,7 @@ class BaseSelectorTestCase(unittest.TestCase):
s = self.SELECTOR()
self.addCleanup(s.close)
+ mapping = s.get_map()
rd, wr = self.make_socketpair()
s.register(rd, selectors.EVENT_READ)
@@ -188,6 +189,8 @@ class BaseSelectorTestCase(unittest.TestCase):
s.close()
self.assertRaises(KeyError, s.get_key, rd)
self.assertRaises(KeyError, s.get_key, wr)
+ self.assertRaises(KeyError, mapping.__getitem__, rd)
+ self.assertRaises(KeyError, mapping.__getitem__, wr)
def test_get_key(self):
s = self.SELECTOR()