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 19
19
import random
20
20
from typing import TYPE_CHECKING , Any , Optional , Union
21
21
22
- from pymongo .common import CONNECT_TIMEOUT , check_for_min_version
22
+ from pymongo .common import CONNECT_TIMEOUT
23
23
from pymongo .errors import ConfigurationError
24
24
25
25
if TYPE_CHECKING :
@@ -32,14 +32,6 @@ def _have_dnspython() -> bool:
32
32
try :
33
33
import dns # noqa: F401
34
34
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
-
43
35
return True
44
36
except ImportError :
45
37
return False
@@ -79,8 +71,6 @@ def __init__(
79
71
srv_service_name : str ,
80
72
srv_max_hosts : int = 0 ,
81
73
):
82
- # Ensure the version of dnspython is compatible.
83
- _have_dnspython ()
84
74
self .__fqdn = fqdn
85
75
self .__srv = srv_service_name
86
76
self .__connect_timeout = connect_timeout or CONNECT_TIMEOUT
Original file line number Diff line number Diff line change 19
19
import random
20
20
from typing import TYPE_CHECKING , Any , Optional , Union
21
21
22
- from pymongo .common import CONNECT_TIMEOUT , check_for_min_version
22
+ from pymongo .common import CONNECT_TIMEOUT
23
23
from pymongo .errors import ConfigurationError
24
24
25
25
if TYPE_CHECKING :
@@ -32,14 +32,6 @@ def _have_dnspython() -> bool:
32
32
try :
33
33
import dns # noqa: F401
34
34
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
-
43
35
return True
44
36
except ImportError :
45
37
return False
@@ -79,8 +71,6 @@ def __init__(
79
71
srv_service_name : str ,
80
72
srv_max_hosts : int = 0 ,
81
73
):
82
- # Ensure the version of dnspython is compatible.
83
- _have_dnspython ()
84
74
self .__fqdn = fqdn
85
75
self .__srv = srv_service_name
86
76
self .__connect_timeout = connect_timeout or CONNECT_TIMEOUT
You can’t perform that action at this time.
0 commit comments