-
Notifications
You must be signed in to change notification settings - Fork 56
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
Change behaviour for timeout <= 0 #28
Conversation
Codecov Report
@@ Coverage Diff @@
## master #28 +/- ##
==========================================
+ Coverage 70.37% 71.42% +1.05%
==========================================
Files 1 1
Lines 54 56 +2
Branches 9 9
==========================================
+ Hits 38 40 +2
Misses 15 15
Partials 1 1
Continue to review full report at Codecov.
|
Locally tests on Python 3.6 works fine, can someone restart travis build for 3.6? |
restarted, but it failed again |
I've had Python 3.6.1 locally and it works there, but fails on Python 3.6.2. I'll take a look on it |
run_until_complete was changed in python/cpython#1688 , it brings fails |
This cgange right now braks expired proerty , Ill fix it |
I think it is not possible to raise immediately Any design\concept ideas? |
only one way is cm = timeout(0)
with cm:
yield from asyncio.sleep(1)
assert cm.expired |
Probably we can document that using properties like |
async_timeout/__init__.py
Outdated
raise RuntimeError('Timeout context manager should be used ' | ||
'inside a task') | ||
|
||
if self._timeout is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move these lines before self._task
check: it allows to run aiohttp client from tornado with disabled timeouts.
I support the idea of raising a timeout error ASAP when timeout is |
@Kentzo it is possible to raise I had conversation with @asvetlov offline regarding raising It will be great to hear more feedback, what is more important support context manager or raise |
@hellysmile I'd agree with @asvetlov regarding not raising the exception instantly. My comment was regarding removing "0 = no timeout" semantics. |
Is there any concerns regarding this PR? |
Everything is perfect, thank you. |
fix for #27
and minor fix for raising
RuntimeError
when used outside task andtimeout is None