Mercurial > hg
comparison mercurial/url.py @ 10411:af4c42ec19ed
ssl: fix compatibility with pre-2.6 Python
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 10 Feb 2010 17:42:57 -0600 |
parents | 4c94a3df4b10 |
children | 677f15da38c1 |
comparison
equal
deleted
inserted
replaced
10410:b59fba37e5e6 | 10411:af4c42ec19ed |
---|---|
270 | 270 |
271 _GLOBAL_DEFAULT_TIMEOUT = object() | 271 _GLOBAL_DEFAULT_TIMEOUT = object() |
272 | 272 |
273 try: | 273 try: |
274 _create_connection = socket.create_connection | 274 _create_connection = socket.create_connection |
275 except ImportError: | 275 except AttributeError: |
276 def _create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, | 276 def _create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, |
277 source_address=None): | 277 source_address=None): |
278 # lifted from Python 2.6 | 278 # lifted from Python 2.6 |
279 | 279 |
280 msg = "getaddrinfo returns an empty list" | 280 msg = "getaddrinfo returns an empty list" |