Skip to content

Commit b9e56fc

Browse files
committed
Clean up to asgi.py
Remove some logs that Mike pointed out, also don't always raise a runtime error and remove fastapi import
1 parent 4485b18 commit b9e56fc

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/pyodide/internal/asgi.py

+2-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from contextlib import contextmanager
33
from inspect import isawaitable
44

5-
from fastapi import Depends, Request
65

76
ASGI = {"spec_version": "2.0", "version": "3.0"}
87

@@ -16,11 +15,6 @@ def run_in_background(coro):
1615
fut.add_done_callback(background_tasks.discard)
1716

1817

19-
@Depends
20-
async def env(request: Request):
21-
return request.scope["env"]
22-
23-
2418
@contextmanager
2519
def acquire_js_buffer(pybuffer):
2620
from pyodide.ffi import create_proxy
@@ -84,11 +78,10 @@ async def receive():
8478

8579
async def send(got):
8680
if got["type"] == "lifespan.startup.complete":
87-
print("Application startup complete.")
88-
print("Uvicorn running")
8981
ready.set_result(None)
82+
return
9083
if got["type"] == "lifespan.shutdown.complete":
91-
print("Application shutdown complete")
84+
return
9285
raise RuntimeError(f"Unexpected lifespan event {got['type']}")
9386

9487
run_in_background(

0 commit comments

Comments
 (0)