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 11import asyncio
2+ import sys
23
34from . import server
45from . import top_queries
56
67
78def main ():
89 """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+
916 asyncio .run (server .main ())
1017
1118
Original file line number Diff line number Diff line change @@ -618,7 +618,3 @@ async def shutdown(sig=None):
618618
619619 # Exit with appropriate status code
620620 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