-
-
Notifications
You must be signed in to change notification settings - Fork 854
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
FIX Check if future is done before trying to set a result on it #4837
Conversation
b71af4e
to
9b8f5cc
Compare
So where we called this |
27f2129
to
337517a
Compare
It's a bit complicated, I haven't sifted through the full control flow. Here's the full traceback, but it's hard to find anything micropip related there. Presumably we cancelled a Future and then it later got sent a result from the browser event loop. We need to throw it away if we're already done. Traceback
|
It's probably from js import fetch
async def f():
while True:
await fetch("/")
from asyncio import *
f = ensure_future(f())
f.cancel() Running this and you will see a similar |
Thanks for the test case. |
c9629d3
to
35fb788
Compare
d3ea1b4
to
05b839e
Compare
Otherwise, future raises invalid state error. Question: should we try to avoid getting to the point where we call this in the first place??
1f7c86d
to
18398b7
Compare
for more information, see https://pre-commit.ci
…ide#4837) Otherwise, the future raises invalid state error
Otherwise, future raises invalid state error. Question: should we try to avoid getting to the point where we call this in the first place??
cc @CNSeniorious000 this fixes the invalid state errors on pyodide/micropip#111
Description