Mercurial > hg
comparison mercurial/sslutil.py @ 31074:2912b06905dc
py3: use pycompat.fsencode() to convert __file__ to bytes
__file__ returns unicodes on Python 3. This patch uses pycompat.fsencode() to
convert them to bytes.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Mon, 20 Feb 2017 18:40:42 +0530 |
parents | 10b17ed9b591 |
children | f819aa9dbbf9 |
comparison
equal
deleted
inserted
replaced
31073:2cf1e5207fdf | 31074:2912b06905dc |
---|---|
718 | 718 |
719 # Apple's OpenSSL has patches that allow a specially constructed certificate | 719 # Apple's OpenSSL has patches that allow a specially constructed certificate |
720 # to load the system CA store. If we're running on Apple Python, use this | 720 # to load the system CA store. If we're running on Apple Python, use this |
721 # trick. | 721 # trick. |
722 if _plainapplepython(): | 722 if _plainapplepython(): |
723 dummycert = os.path.join(os.path.dirname(__file__), 'dummycert.pem') | 723 dummycert = os.path.join( |
724 os.path.dirname(pycompat.fsencode(__file__)), 'dummycert.pem') | |
724 if os.path.exists(dummycert): | 725 if os.path.exists(dummycert): |
725 return dummycert | 726 return dummycert |
726 | 727 |
727 # The Apple OpenSSL trick isn't available to us. If Python isn't able to | 728 # The Apple OpenSSL trick isn't available to us. If Python isn't able to |
728 # load system certs, we're out of luck. | 729 # load system certs, we're out of luck. |