Only return a path if the cacert.pem file exists.
authorJohn Peacock <jpeacock@jpeacock.int.messagesystems.com>
Wed, 21 Nov 2012 18:34:03 +0000 (13:34 -0500)
committerJohn Peacock <jpeacock@jpeacock.int.messagesystems.com>
Wed, 21 Nov 2012 18:34:03 +0000 (13:34 -0500)
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

index b3d33f4..fd96d28 100644 (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