File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 1
1
import asyncio
2
+ import sys
2
3
3
4
from . import server
4
5
from . import top_queries
5
6
6
7
7
8
def main ():
8
9
"""Main entry point for the package."""
10
+ # As of version 3.3.0 Psycopg on Windows is not compatible with the default
11
+ # ProactorEventLoop.
12
+ # See: https://www.psycopg.org/psycopg3/docs/advanced/async.html#async
13
+ if sys .platform == "win32" :
14
+ asyncio .set_event_loop_policy (asyncio .WindowsSelectorEventLoopPolicy ())
15
+
9
16
asyncio .run (server .main ())
10
17
11
18
Original file line number Diff line number Diff line change @@ -618,7 +618,3 @@ async def shutdown(sig=None):
618
618
619
619
# Exit with appropriate status code
620
620
sys .exit (128 + sig if sig is not None else 0 )
621
-
622
-
623
- if __name__ == "__main__" :
624
- asyncio .run (main ())
You can’t perform that action at this time.
0 commit comments