This revision was automatically updated to reflect the committed changes.
Closed by commit rHG569d662816de: mail: modernize check for Python-with-TLS
(authored by durin42, committed by ).
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D3955?vs=10195=10247
indygreg accepted this revision.
indygreg added a comment.
This revision is now accepted and ready to land.
I think this utility function should live in `sslutil.py`.
INLINE COMMENTS
> mail.py:85-92
> +def _pyhastls():
> +"""Returns true iff Python has TLS support, false otherwise."""
>
durin42 updated this revision to Diff 10195.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D3955?vs=10191=10195
REVISION DETAIL
https://phab.mercurial-scm.org/D3955
AFFECTED FILES
mercurial/mail.py
CHANGE DETAILS
diff --git a/mercurial/mail.py
durin42 updated this revision to Diff 10191.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D3955?vs=9611=10191
REVISION DETAIL
https://phab.mercurial-scm.org/D3955
AFFECTED FILES
mercurial/mail.py
CHANGE DETAILS
diff --git a/mercurial/mail.py
yuja added a comment.
> > 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
> > 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
durin42 added a comment.
> 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
> +def _pyhastls():
> +"""Returns true iff Python has TLS support, false otherwise."""
> +try:
> +import ssl
> +getattr(ssl, 'HAS_TLS', False)
> +return True
> +except ImportError:
> +return False
Maybe we can simply remove the check since we've dropped
yuja added a comment.
> +def _pyhastls():
> +"""Returns true iff Python has TLS support, false otherwise."""
> +try:
> +import ssl
> +getattr(ssl, 'HAS_TLS', False)
> +return True
> +except ImportError:
> +return False
Maybe
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
We used to be going indirectly through the socket module, but now we
just check for the ssl module.
REPOSITORY
rHG Mercurial
REVISION DETAIL
10 matches
Mail list logo