Skip to content

Commit

Permalink
Small fix for documentation on using SSL in Connection (#995)
Browse files Browse the repository at this point in the history
The sample code shows asyncio.run(run()), but the function
to be run is named "main()".  So this sample does not run.
  • Loading branch information
ScottFred authored Oct 9, 2023
1 parent 313b2b2 commit ccc7baf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions asyncpg/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2041,7 +2041,7 @@ async def connect(dsn=None, *,
... )
... con = await asyncpg.connect(user='postgres', ssl=sslctx)
... await con.close()
>>> asyncio.run(run())
>>> asyncio.run(main())
Example of programmatic SSL context configuration that is equivalent
to ``sslmode=require`` (no server certificate or host verification):
Expand All @@ -2058,7 +2058,7 @@ async def connect(dsn=None, *,
... sslctx.verify_mode = ssl.CERT_NONE
... con = await asyncpg.connect(user='postgres', ssl=sslctx)
... await con.close()
>>> asyncio.run(run())
>>> asyncio.run(main())
:param bool direct_tls:
Pass ``True`` to skip PostgreSQL STARTTLS mode and perform a direct
Expand Down

0 comments on commit ccc7baf

Please sign in to comment.