Skip to content

extmod/asyncio/event.py: Fix ThreadSafeFlag.ioctl return. #12443

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

Merged
merged 2 commits into from
Sep 29, 2023
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: 1 addition & 1 deletion extmod/asyncio/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(self):
def ioctl(self, req, flags):
if req == 3: # MP_STREAM_POLL
return self.state * flags
return None
return -1 # Other requests are unsupported

def set(self):
self.state = 1
Expand Down
13 changes: 0 additions & 13 deletions tests/extmod/asyncio_threadsafeflag.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,14 @@
raise SystemExit


try:
# Unix port can't select/poll on user-defined types.
import select

poller = select.poll()
poller.register(asyncio.ThreadSafeFlag())
except TypeError:
print("SKIP")
raise SystemExit


async def task(id, flag):
print("task", id)
await flag.wait()
print("task", id, "done")


def set_from_schedule(flag):
print("schedule")
flag.set()
print("schedule done")


async def main():
Expand Down
2 changes: 0 additions & 2 deletions tests/extmod/asyncio_threadsafeflag.py.exp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ yield
task 2
set event
yield
schedule
schedule done
wait task
task 2 done
----
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy