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.
This commit is contained in:
John Peacock
2012-11-21 13:34:03 -05:00
parent 50877717c8
commit c5fddb95ed
+3 -1
View File
@@ -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