diff options
author | Senthil Kumaran <senthil@uthcode.com> | 2011-07-30 02:56:50 (GMT) |
---|---|---|
committer | Senthil Kumaran <senthil@uthcode.com> | 2011-07-30 02:56:50 (GMT) |
commit | 3d23fd649309fe80fdd1dee04b668fefb50c1b97 (patch) | |
tree | 912395e2e554691e6b32a3dbab7b1254a15381fc /Lib/test/mock_socket.py | |
parent | f83e4acbaec012e01e11d5cc4ea6514cf2a7b34c (diff) | |
download | cpython-3d23fd649309fe80fdd1dee04b668fefb50c1b97.zip cpython-3d23fd649309fe80fdd1dee04b668fefb50c1b97.tar.gz cpython-3d23fd649309fe80fdd1dee04b668fefb50c1b97.tar.bz2 |
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.
Diffstat (limited to 'Lib/test/mock_socket.py')
-rw-r--r-- | Lib/test/mock_socket.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/mock_socket.py b/Lib/test/mock_socket.py index 8036932..d09e78c 100644 --- a/Lib/test/mock_socket.py +++ b/Lib/test/mock_socket.py @@ -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: |