File tree Expand file tree Collapse file tree 2 files changed +2
-22
lines changed Expand file tree Collapse file tree 2 files changed +2
-22
lines changed Original file line number Diff line number Diff line change 1919import random
2020from typing import TYPE_CHECKING , Any , Optional , Union
2121
22- from pymongo .common import CONNECT_TIMEOUT , check_for_min_version
22+ from pymongo .common import CONNECT_TIMEOUT
2323from pymongo .errors import ConfigurationError
2424
2525if TYPE_CHECKING :
@@ -32,14 +32,6 @@ def _have_dnspython() -> bool:
3232 try :
3333 import dns # noqa: F401
3434
35- dns_version , required_version , is_valid = check_for_min_version ("dnspython" )
36- if not is_valid :
37- raise RuntimeError (
38- f"pymongo requires dnspython>={ required_version } , "
39- f"found version { dns_version } . "
40- "Install a compatible version with pip"
41- )
42-
4335 return True
4436 except ImportError :
4537 return False
@@ -79,8 +71,6 @@ def __init__(
7971 srv_service_name : str ,
8072 srv_max_hosts : int = 0 ,
8173 ):
82- # Ensure the version of dnspython is compatible.
83- _have_dnspython ()
8474 self .__fqdn = fqdn
8575 self .__srv = srv_service_name
8676 self .__connect_timeout = connect_timeout or CONNECT_TIMEOUT
Original file line number Diff line number Diff line change 1919import random
2020from typing import TYPE_CHECKING , Any , Optional , Union
2121
22- from pymongo .common import CONNECT_TIMEOUT , check_for_min_version
22+ from pymongo .common import CONNECT_TIMEOUT
2323from pymongo .errors import ConfigurationError
2424
2525if TYPE_CHECKING :
@@ -32,14 +32,6 @@ def _have_dnspython() -> bool:
3232 try :
3333 import dns # noqa: F401
3434
35- dns_version , required_version , is_valid = check_for_min_version ("dnspython" )
36- if not is_valid :
37- raise RuntimeError (
38- f"pymongo requires dnspython>={ required_version } , "
39- f"found version { dns_version } . "
40- "Install a compatible version with pip"
41- )
42-
4335 return True
4436 except ImportError :
4537 return False
@@ -79,8 +71,6 @@ def __init__(
7971 srv_service_name : str ,
8072 srv_max_hosts : int = 0 ,
8173 ):
82- # Ensure the version of dnspython is compatible.
83- _have_dnspython ()
8474 self .__fqdn = fqdn
8575 self .__srv = srv_service_name
8676 self .__connect_timeout = connect_timeout or CONNECT_TIMEOUT
You can’t perform that action at this time.
0 commit comments