Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid creating TimerContext when there is no timeout #1817

Merged
merged 1 commit into from
Apr 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Changes

- Added `iter_chunks` to response.content object. #1805

- Avoid creating TimerContext when there is no timeout to allow compatibility with Tornado. #1817 #1180


2.0.7 (2017-04-12)
------------------
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Jesus Cea
Jinkyu Yi
Joel Watts
Joongi Kim
Josep Cugat
Julia Tsemusheva
Julien Duponchelle
Junjie Tao
Expand Down
7 changes: 5 additions & 2 deletions aiohttp/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,11 @@ def start(self):
return self._loop.call_at(at, self.__call__)

def timer(self):
timer = TimerContext(self._loop)
self.register(timer.timeout)
if self._timeout is not None and self._timeout > 0:
timer = TimerContext(self._loop)
self.register(timer.timeout)
else:
timer = TimerNoop()
return timer

def __call__(self):
Expand Down