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:
Senthil Kumaran 2011-07-30 10:56:50 +08:00
parent f83e4acbae
commit 3d23fd6493
5 changed files with 75 additions and 22 deletions

View file

@ -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: