From 20cd46426fda1b048afa90955f445424efa4be46 Mon Sep 17 00:00:00 2001 From: John Peacock Date: Wed, 21 Nov 2012 13:41:16 -0500 Subject: [PATCH] Only return a path if the cacert.pem file exists. This will permit the deletion of just that one file in order to fall back to the [probably more accurate but less consistent] Distro provided CA certs. --- requests/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/requests/utils.py b/requests/utils.py index b3d33f4..fd96d28 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -29,7 +29,9 @@ CERTIFI_BUNDLE_PATH = None try: # see if requests's own CA certificate bundle is installed from . import certs - CERTIFI_BUNDLE_PATH = certs.where() + path = certs.where() + if os.path.exists(path): + CERTIFI_BUNDLE_PATH = certs.where() except ImportError: pass -- 2.34.1