From 1cbf01f307560a5f15b0ea3a06747645d6dd4bb2 Mon Sep 17 00:00:00 2001 From: AresValley Date: Tue, 4 Oct 2022 13:35:42 +0200 Subject: [PATCH] Nuitka compatibility for cacert.pem path --- src/web_utilities.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/web_utilities.py b/src/web_utilities.py index 0896d6e..a89c091 100644 --- a/src/web_utilities.py +++ b/src/web_utilities.py @@ -7,8 +7,9 @@ from executable_utilities import IS_BINARY def get_cacert_file(): - """Return the path to the cacert.pem file.""" - if IS_BINARY: + """Return the path to the cacert.pem file. + PyInstaller requires _MEIPASS, Nuitka does not.""" + if IS_BINARY and not "__compiled__" in globals(): ca_certs = os.path.join(sys._MEIPASS, 'cacert.pem') else: ca_certs = 'cacert.pem'