Skip to content

Commit c97d092

Browse files
committed
Fix response.write_eof() to follow aiohttp changes
1 parent 5ae6a5c commit c97d092

File tree

5 files changed

+11
-4
lines changed

5 files changed

+11
-4
lines changed

CHANGES.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGES
22
-------
33

4+
0.2.5 (2014-10-30)
5+
^^^^^^^^^^^^^^^^^^
6+
7+
* Fix response.write_eof() to follow aiohttp changes
8+
49
0.2.4 (2014-09-12)
510
^^^^^^^^^^^^^^^^^^
611

aiorest/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import sys
44

55

6-
__version__ = '0.2.4'
6+
__version__ = '0.2.5'
77

88
version = __version__ + ' , Python ' + sys.version
99

aiorest/errors.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import aiohttp
2+
import asyncio
23
import json
34

45

@@ -28,6 +29,7 @@ def __init__(self, code, message='', json_body={}, headers=None):
2829
self.body = json.dumps(body).encode('utf-8')
2930
self.headers = headers
3031

32+
@asyncio.coroutine
3133
def write_response(self, response):
3234
if self.body is not None:
3335
response.add_headers(
@@ -45,7 +47,7 @@ def write_response(self, response):
4547

4648
if self.body is not None:
4749
response.write(self.body)
48-
response.write_eof()
50+
yield from response.write_eof()
4951

5052

5153
class HttpCorsOptions(RESTError):

aiorest/handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def handle_error(self, status=500, message=None, payload=None,
100100
if isinstance(exc, errors.RESTError):
101101
resp_impl = aiohttp.Response(self.writer, status, close=True)
102102
resp_impl.add_header('Host', self.hostname)
103-
exc.write_response(resp_impl)
103+
yield from exc.write_response(resp_impl)
104104
self.log_access(message, None, resp_impl, time.time() - now)
105105
self.keep_alive(False)
106106
else:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import sys
44
from setuptools import setup, find_packages
55

6-
install_requires = ['aiohttp>=0.9.0']
6+
install_requires = ['aiohttp>=0.9.3']
77

88
PY_VER = sys.version_info
99

0 commit comments

Comments
 (0)