diff --git a/doc/python.rst b/doc/python.rst index 296a14f..594df51 100644 --- a/doc/python.rst +++ b/doc/python.rst @@ -258,8 +258,9 @@ Session Objects Puts back previously deferred DATA frame in the stream *stream_id* to the outbound queue. - The :py:class:`InvalidArgumentError` will be raised if the stream - does not exist or no deferred data exist. + This method returns ``True`` if it succeeds, or ``False``. This + method will fail if the stream does not exist or no deferred data + exist. .. py:method:: Session.want_read() diff --git a/python/spdylay.pyx b/python/spdylay.pyx index a2807a0..3b694d8 100644 --- a/python/spdylay.pyx +++ b/python/spdylay.pyx @@ -778,9 +778,9 @@ cdef class Session: cpdef int rv rv = cspdylay.spdylay_session_resume_data(self._c_session, stream_id) if rv == 0: - return + return True elif rv == cspdylay.SPDYLAY_ERR_INVALID_ARGUMENT: - raise InvalidArgumentError(_strerror(rv)) + return False elif rv == cspdylay.SPDYLAY_ERR_NOMEM: raise MemoryError() diff --git a/python/spdylay_tests.py b/python/spdylay_tests.py index 0ae3720..196e943 100644 --- a/python/spdylay_tests.py +++ b/python/spdylay_tests.py @@ -174,8 +174,7 @@ class SpdylayTests(unittest.TestCase): self.assertEqual(spdylay.GOAWAY_PROTOCOL_ERROR, frame.status_code) def test_resume_data(self): - with self.assertRaises(spdylay.InvalidArgumentError): - self.client_session.resume_data(1) + self.assertFalse(self.client_session.resume_data(1)) def test_get_pri_lowest(self): self.assertEqual(7, self.client_session.get_pri_lowest())