We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b9d99f commit d173517Copy full SHA for d173517
frameworks/Python/aiohttp/app/main.py
@@ -1,7 +1,7 @@
1
-import os
2
import multiprocessing
+import os
3
+import platform
4
-import asyncpg
5
from aiohttp import web
6
from sqlalchemy.engine.url import URL
7
from sqlalchemy.ext.asyncio import async_sessionmaker, create_async_engine
@@ -20,6 +20,9 @@
20
updates_raw,
21
)
22
23
+if platform.python_implementation() != "PyPy":
24
+ import asyncpg
25
+
26
CONNECTION_ORM = os.getenv('CONNECTION', 'ORM').upper() == 'ORM'
27
28
@@ -84,6 +87,7 @@ def setup_routes(app):
84
87
85
88
def create_app():
86
89
app = web.Application()
- app.cleanup_ctx.append(db_ctx)
90
+ if platform.python_implementation() != "PyPy":
91
+ app.cleanup_ctx.append(db_ctx)
92
setup_routes(app)
93
return app
0 commit comments