mirror of
https://github.com/python/cpython.git
synced 2025-10-06 23:21:06 +00:00
Fix closes Issue11281 - smtplib.STMP gets source_address parameter, which adds the ability to bind to specific source address on a machine with multiple interfaces. Patch by Paulo Scardine.
This commit is contained in:
parent
f83e4acbae
commit
3d23fd6493
5 changed files with 75 additions and 22 deletions
|
@ -106,7 +106,8 @@ def socket(family=None, type=None, proto=None):
|
|||
return MockSocket()
|
||||
|
||||
|
||||
def create_connection(address, timeout=socket_module._GLOBAL_DEFAULT_TIMEOUT):
|
||||
def create_connection(address, timeout=socket_module._GLOBAL_DEFAULT_TIMEOUT,
|
||||
source_address=None):
|
||||
try:
|
||||
int_port = int(address[1])
|
||||
except ValueError:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue