radhermit    14/12/04 03:32:03

  Added:                requests-2.5.0-system-cacerts.patch
  Log:
  Fix system-cacerts patch.
  
  (Portage version: 2.2.14/cvs/Linux x86_64, signed Manifest commit with key 
4AB3E85B4F064CA3)

Revision  Changes    Path
1.1                  
dev-python/requests/files/requests-2.5.0-system-cacerts.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/requests/files/requests-2.5.0-system-cacerts.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/requests/files/requests-2.5.0-system-cacerts.patch?rev=1.1&content-type=text/plain

Index: requests-2.5.0-system-cacerts.patch
===================================================================
--- requests-2.5.0/requests/certs.py
+++ requests-2.5.0/requests/certs.py
@@ -13,13 +13,14 @@
 """
 import os.path
 
-try:
-    from certifi import where
-except ImportError:
-    def where():
-        """Return the preferred certificate bundle."""
-        # vendored bundle inside Requests
-        return os.path.join(os.path.dirname(__file__), 'cacert.pem')
+def where():
+    """Return the preferred certificate bundle."""
+    cacerts = '/etc/ssl/certs/ca-certificates.crt'
+    if os.path.exists(cacerts):
+        return cacerts
+
+    # vendored bundle inside Requests
+    return os.path.join(os.path.dirname(__file__), 'cacert.pem')
 
 if __name__ == '__main__':
     print(where())




Reply via email to