Commit 3207a030 authored by Andrew Svetlov's avatar Andrew Svetlov

Fix for raising exception not derived from BaseException in _SelectorSslTransport.resume_reading

parent 0a4d13e8
...@@ -670,7 +670,7 @@ class _SelectorSslTransport(_SelectorTransport): ...@@ -670,7 +670,7 @@ class _SelectorSslTransport(_SelectorTransport):
def resume_reading(self): def resume_reading(self):
if not self._paused: if not self._paused:
raise ('Not paused') raise RuntimeError('Not paused')
self._paused = False self._paused = False
if self._closing: if self._closing:
return return
......
...@@ -711,6 +711,8 @@ class SelectorSocketTransportTests(unittest.TestCase): ...@@ -711,6 +711,8 @@ class SelectorSocketTransportTests(unittest.TestCase):
tr.resume_reading() tr.resume_reading()
self.assertFalse(tr._paused) self.assertFalse(tr._paused)
self.loop.assert_reader(7, tr._read_ready) self.loop.assert_reader(7, tr._read_ready)
with self.assertRaises(RuntimeError):
tr.resume_reading()
def test_read_ready(self): def test_read_ready(self):
transport = _SelectorSocketTransport( transport = _SelectorSocketTransport(
...@@ -1125,6 +1127,8 @@ class SelectorSslTransportTests(unittest.TestCase): ...@@ -1125,6 +1127,8 @@ class SelectorSslTransportTests(unittest.TestCase):
tr.resume_reading() tr.resume_reading()
self.assertFalse(tr._paused) self.assertFalse(tr._paused)
self.loop.assert_reader(1, tr._read_ready) self.loop.assert_reader(1, tr._read_ready)
with self.assertRaises(RuntimeError):
tr.resume_reading()
def test_write(self): def test_write(self):
transport = self._make_one() transport = self._make_one()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment