File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 39
39
DOT_ATOM_TEXT = DOT_ATOM_TEXT .decode ("ascii" )
40
40
ATEXT_HOSTNAME = ATEXT_HOSTNAME .decode ("ascii" )
41
41
42
+ DEFAULT_TIMEOUT = 15 # secs
43
+
42
44
class EmailNotValidError (ValueError ):
43
45
"""Parent class of all exceptions raised by this module."""
44
46
pass
@@ -56,7 +58,7 @@ def validate_email(
56
58
allow_smtputf8 = True ,
57
59
allow_empty_local = False ,
58
60
check_deliverability = True ,
59
- timeout = 0 ):
61
+ timeout = DEFAULT_TIMEOUT ):
60
62
61
63
"""Validates an email address, raising an EmailNotValidError if the address is not valid or returning a dict of information
62
64
when the address is valid. The email argument can be a str or a bytes instance, but if bytes it must be ASCII-only."""
@@ -234,7 +236,7 @@ def validate_email_domain_part(domain):
234
236
"domain_i18n" : domain_i18n ,
235
237
}
236
238
237
- def validate_email_deliverability (domain , domain_i18n , timeout = 0 ):
239
+ def validate_email_deliverability (domain , domain_i18n , timeout = DEFAULT_TIMEOUT ):
238
240
# Check that the domain resolves to an MX record. If there is no MX record,
239
241
# try an A or AAAA record which is a deprecated fallback for deliverability.
240
242
You can’t perform that action at this time.
0 commit comments