D3955: mail: modernize check for Python-with-TLS

Yuya Nishihara yuya at tcha.org
Wed Jul 18 07:47:42 EDT 2018


>   >   Maybe we can simply remove the check since we've dropped support for
>   >   Python 2.5.
>   
>   No, we're looking to see if the ssl module is importable - if it's not, that means Python was compiled without TLS support (which is an option, even on 3.x and 2.7). I'm just sniffing for this particular attribute to force the import.

That's true, but I don't think we've ever had support for Python 2.6+ without
OpenSSL. Some commands would work thanks to our demandimport, but it also means
some stdlib modules (e.g. httlib) would be broken because `import ssl` doesn't
fail.


More information about the Mercurial-devel mailing list