Mercurial > public > mercurial-scm > hg
comparison mercurial/sslutil.py @ 43671:664e24207728
procutil: move mainfrozen() to new resourceutil.py
The i18n module practically depends on procutil for mainfrozen() but
since procutil depends on i18n, it would be a circular dependency if
i18n depended directly on procutil. The cycle is currently resolved by
having the higher-level util module calculate the "datapath" and
inject it into i18n. Extracting mainfrozen() to a new module lets us
clean up the dependencies.
Differential Revision: https://phab.mercurial-scm.org/D7433
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 14 Nov 2019 11:52:22 -0800 |
parents | 9f70512ae2cf |
children | cbc5755df6bf |
comparison
equal
deleted
inserted
replaced
43670:02fe8dedab8c | 43671:664e24207728 |
---|---|
22 node, | 22 node, |
23 pycompat, | 23 pycompat, |
24 util, | 24 util, |
25 ) | 25 ) |
26 from .utils import ( | 26 from .utils import ( |
27 procutil, | 27 resourceutil, |
28 stringutil, | 28 stringutil, |
29 ) | 29 ) |
30 | 30 |
31 # Python 2.7.9+ overhauled the built-in SSL/TLS features of Python. It added | 31 # Python 2.7.9+ overhauled the built-in SSL/TLS features of Python. It added |
32 # support for TLS 1.1, TLS 1.2, SNI, system CA stores, etc. These features are | 32 # support for TLS 1.1, TLS 1.2, SNI, system CA stores, etc. These features are |
784 for using system certificate store CAs in addition to the provided | 784 for using system certificate store CAs in addition to the provided |
785 cacerts file | 785 cacerts file |
786 """ | 786 """ |
787 if ( | 787 if ( |
788 not pycompat.isdarwin | 788 not pycompat.isdarwin |
789 or procutil.mainfrozen() | 789 or resourceutil.mainfrozen() |
790 or not pycompat.sysexecutable | 790 or not pycompat.sysexecutable |
791 ): | 791 ): |
792 return False | 792 return False |
793 exe = os.path.realpath(pycompat.sysexecutable).lower() | 793 exe = os.path.realpath(pycompat.sysexecutable).lower() |
794 return exe.startswith(b'/usr/bin/python') or exe.startswith( | 794 return exe.startswith(b'/usr/bin/python') or exe.startswith( |