Nuitka compatibility for cacert.pem path

This commit is contained in:
AresValley
2022-10-04 13:35:42 +02:00
parent 93a946e2a9
commit 1cbf01f307

View File

@@ -7,8 +7,9 @@ from executable_utilities import IS_BINARY
def get_cacert_file(): def get_cacert_file():
"""Return the path to the cacert.pem file.""" """Return the path to the cacert.pem file.
if IS_BINARY: PyInstaller requires _MEIPASS, Nuitka does not."""
if IS_BINARY and not "__compiled__" in globals():
ca_certs = os.path.join(sys._MEIPASS, 'cacert.pem') ca_certs = os.path.join(sys._MEIPASS, 'cacert.pem')
else: else:
ca_certs = 'cacert.pem' ca_certs = 'cacert.pem'