summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2014-05-27 18:25:31 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2014-05-27 18:25:31 (GMT)
commita5f6ef84575e51a54fe536dea050af22c1ae37a0 (patch)
tree9310c4f1e73992190b2fae412b88863e087ca70e /Lib
parent1086fb0947bf5a599b28394c30acc65b911ce695 (diff)
parent3207a03035deabbff8a68f4f29dc33d1da944801 (diff)
downloadcpython-a5f6ef84575e51a54fe536dea050af22c1ae37a0.zip
cpython-a5f6ef84575e51a54fe536dea050af22c1ae37a0.tar.gz
cpython-a5f6ef84575e51a54fe536dea050af22c1ae37a0.tar.bz2
Fix for raising exception not derived from BaseException in _SelectorSslTransport.resume_reading
Diffstat (limited to 'Lib')
-rw-r--r--Lib/asyncio/selector_events.py2
-rw-r--r--Lib/test/test_asyncio/test_selector_events.py4
2 files changed, 5 insertions, 1 deletions
diff --git a/Lib/asyncio/selector_events.py b/Lib/asyncio/selector_events.py
index c7df8d8..86a8d23 100644
--- a/Lib/asyncio/selector_events.py
+++ b/Lib/asyncio/selector_events.py
@@ -670,7 +670,7 @@ class _SelectorSslTransport(_SelectorTransport):
def resume_reading(self):
if not self._paused:
- raise ('Not paused')
+ raise RuntimeError('Not paused')
self._paused = False
if self._closing:
return
diff --git a/Lib/test/test_asyncio/test_selector_events.py b/Lib/test/test_asyncio/test_selector_events.py
index 0735237..d7fafab 100644
--- a/Lib/test/test_asyncio/test_selector_events.py
+++ b/Lib/test/test_asyncio/test_selector_events.py
@@ -711,6 +711,8 @@ class SelectorSocketTransportTests(unittest.TestCase):
tr.resume_reading()
self.assertFalse(tr._paused)
self.loop.assert_reader(7, tr._read_ready)
+ with self.assertRaises(RuntimeError):
+ tr.resume_reading()
def test_read_ready(self):
transport = _SelectorSocketTransport(
@@ -1125,6 +1127,8 @@ class SelectorSslTransportTests(unittest.TestCase):
tr.resume_reading()
self.assertFalse(tr._paused)
self.loop.assert_reader(1, tr._read_ready)
+ with self.assertRaises(RuntimeError):
+ tr.resume_reading()
def test_write(self):
transport = self._make_one()