Skip to content

Commit

Permalink
Fix response.write_eof() to follow aiohttp changes
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Oct 30, 2014
1 parent 5ae6a5c commit c97d092
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
CHANGES
-------

0.2.5 (2014-10-30)
^^^^^^^^^^^^^^^^^^

* Fix response.write_eof() to follow aiohttp changes

0.2.4 (2014-09-12)
^^^^^^^^^^^^^^^^^^

Expand Down
2 changes: 1 addition & 1 deletion aiorest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys


__version__ = '0.2.4'
__version__ = '0.2.5'

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

Expand Down
4 changes: 3 additions & 1 deletion aiorest/errors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import aiohttp
import asyncio
import json


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

@asyncio.coroutine
def write_response(self, response):
if self.body is not None:
response.add_headers(
Expand All @@ -45,7 +47,7 @@ def write_response(self, response):

if self.body is not None:
response.write(self.body)
response.write_eof()
yield from response.write_eof()


class HttpCorsOptions(RESTError):
Expand Down
2 changes: 1 addition & 1 deletion aiorest/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def handle_error(self, status=500, message=None, payload=None,
if isinstance(exc, errors.RESTError):
resp_impl = aiohttp.Response(self.writer, status, close=True)
resp_impl.add_header('Host', self.hostname)
exc.write_response(resp_impl)
yield from exc.write_response(resp_impl)
self.log_access(message, None, resp_impl, time.time() - now)
self.keep_alive(False)
else:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys
from setuptools import setup, find_packages

install_requires = ['aiohttp>=0.9.0']
install_requires = ['aiohttp>=0.9.3']

PY_VER = sys.version_info

Expand Down

0 comments on commit c97d092

Please sign in to comment.