Skip to content

Commit fa2c1e5

Browse files
authored
Rename _Retry to _RetryConnectSignal (#723)
1 parent 5cf4089 commit fa2c1e5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

asyncpg/connect_utils.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ async def _connect_addr(
630630
before = time.monotonic()
631631
try:
632632
return await __connect_addr(params, timeout, True, *args)
633-
except _Retry:
633+
except _RetryConnectSignal:
634634
pass
635635

636636
# second attempt
@@ -641,7 +641,7 @@ async def _connect_addr(
641641
return await __connect_addr(params_retry, timeout, False, *args)
642642

643643

644-
class _Retry(Exception):
644+
class _RetryConnectSignal(Exception):
645645
pass
646646

647647

@@ -687,7 +687,7 @@ async def __connect_addr(
687687
tr.close()
688688

689689
# retry=True here is a redundant check because we don't want to
690-
# accidentally raise the internal _Retry to the outer world
690+
# accidentally raise the internal _RetryConnectSignal to the user
691691
if retry and (
692692
params.sslmode == SSLMode.allow and not pr.is_ssl or
693693
params.sslmode == SSLMode.prefer and pr.is_ssl
@@ -697,7 +697,7 @@ async def __connect_addr(
697697
# 2. First attempt with sslmode=prefer, ssl=ctx failed while the
698698
# server claimed to support SSL (returning "S" for SSLRequest)
699699
# (likely because pg_hba.conf rejected the connection)
700-
raise _Retry()
700+
raise _RetryConnectSignal()
701701

702702
else:
703703
# but will NOT retry if:

0 commit comments

Comments
 (0)