Skip to content

Commit abe6b24

Browse files
committed
getaddrinfo -> _getaddrinfo
1 parent 85e59fd commit abe6b24

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

pymongo/asynchronous/auth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
_authenticate_oidc,
3939
_get_authenticator,
4040
)
41-
from pymongo.asynchronous.helpers import getaddrinfo
41+
from pymongo.asynchronous.helpers import _getaddrinfo
4242
from pymongo.auth_shared import (
4343
MongoCredential,
4444
_authenticate_scram_start,
@@ -185,7 +185,7 @@ async def _canonicalize_hostname(hostname: str, option: str | bool) -> str:
185185
return hostname
186186

187187
af, socktype, proto, canonname, sockaddr = (
188-
await getaddrinfo(
188+
await _getaddrinfo(
189189
hostname,
190190
None,
191191
family=0,

pymongo/asynchronous/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ async def inner(*args: Any, **kwargs: Any) -> Any:
7070
return cast(F, inner)
7171

7272

73-
async def getaddrinfo(
73+
async def _getaddrinfo(
7474
host: Any, port: Any, **kwargs: Any
7575
) -> list[
7676
tuple[

pymongo/asynchronous/pool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
from bson import DEFAULT_CODEC_OPTIONS
4141
from pymongo import _csot, helpers_shared
4242
from pymongo.asynchronous.client_session import _validate_session_write_concern
43-
from pymongo.asynchronous.helpers import _handle_reauth, getaddrinfo
43+
from pymongo.asynchronous.helpers import _getaddrinfo, _handle_reauth
4444
from pymongo.asynchronous.network import command, receive_message
4545
from pymongo.common import (
4646
MAX_BSON_SIZE,
@@ -814,7 +814,7 @@ async def _create_connection(address: _Address, options: PoolOptions) -> socket.
814814
family = socket.AF_UNSPEC
815815

816816
err = None
817-
for res in await getaddrinfo(host, port, family=family, type=socket.SOCK_STREAM): # type: ignore[attr-defined]
817+
for res in await _getaddrinfo(host, port, family=family, type=socket.SOCK_STREAM): # type: ignore[attr-defined]
818818
af, socktype, proto, dummy, sa = res
819819
# SOCK_CLOEXEC was new in CPython 3.2, and only available on a limited
820820
# number of platforms (newer Linux and *BSD). Starting with CPython 3.4

pymongo/synchronous/auth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
_authenticate_oidc,
4646
_get_authenticator,
4747
)
48-
from pymongo.synchronous.helpers import getaddrinfo
48+
from pymongo.synchronous.helpers import _getaddrinfo
4949

5050
if TYPE_CHECKING:
5151
from pymongo.hello import Hello
@@ -182,7 +182,7 @@ def _canonicalize_hostname(hostname: str, option: str | bool) -> str:
182182
return hostname
183183

184184
af, socktype, proto, canonname, sockaddr = (
185-
getaddrinfo(
185+
_getaddrinfo(
186186
hostname,
187187
None,
188188
family=0,

pymongo/synchronous/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def inner(*args: Any, **kwargs: Any) -> Any:
7070
return cast(F, inner)
7171

7272

73-
def getaddrinfo(
73+
def _getaddrinfo(
7474
host: Any, port: Any, **kwargs: Any
7575
) -> list[
7676
tuple[

pymongo/synchronous/pool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
from pymongo.socket_checker import SocketChecker
8585
from pymongo.ssl_support import HAS_SNI, SSLError
8686
from pymongo.synchronous.client_session import _validate_session_write_concern
87-
from pymongo.synchronous.helpers import _handle_reauth, getaddrinfo
87+
from pymongo.synchronous.helpers import _getaddrinfo, _handle_reauth
8888
from pymongo.synchronous.network import command, receive_message
8989

9090
if TYPE_CHECKING:
@@ -812,7 +812,7 @@ def _create_connection(address: _Address, options: PoolOptions) -> socket.socket
812812
family = socket.AF_UNSPEC
813813

814814
err = None
815-
for res in getaddrinfo(host, port, family=family, type=socket.SOCK_STREAM): # type: ignore[attr-defined]
815+
for res in _getaddrinfo(host, port, family=family, type=socket.SOCK_STREAM): # type: ignore[attr-defined]
816816
af, socktype, proto, dummy, sa = res
817817
# SOCK_CLOEXEC was new in CPython 3.2, and only available on a limited
818818
# number of platforms (newer Linux and *BSD). Starting with CPython 3.4

0 commit comments

Comments
 (0)