Update verify check and doc-string
authorIan Cordasco <graffatcolmingov@gmail.com>
Sun, 24 Aug 2014 14:54:56 +0000 (09:54 -0500)
committerIan Cordasco <graffatcolmingov@gmail.com>
Tue, 26 Aug 2014 19:20:19 +0000 (14:20 -0500)
requests/sessions.py

index dafa9567a8100944b5914205f3e95cf406626968..508b0ef29af4514db4383e6dc36a9bf56cf27c3e 100644 (file)
@@ -593,7 +593,7 @@ class Session(SessionRedirectMixin):
         return r
 
     def merge_environment_settings(self, url, proxies, stream, verify, cert):
-        """Checks the environment and merges it with some settings."""
+        """Check the environment and merge it with some settings."""
         # Gather clues from the surrounding environment.
         if self.trust_env:
             # Set environment's proxies.
@@ -601,13 +601,11 @@ class Session(SessionRedirectMixin):
             for (k, v) in env_proxies.items():
                 proxies.setdefault(k, v)
 
-            # Look for configuration.
+            # Look for requests environment configuration and be compatible
+            # with cURL.
             if verify is True or verify is None:
-                verify = os.environ.get('REQUESTS_CA_BUNDLE')
-
-            # Curl compatibility.
-            if verify is True or verify is None:
-                verify = os.environ.get('CURL_CA_BUNDLE')
+                verify = (os.environ.get('REQUESTS_CA_BUNDLE') or
+                          os.environ.get('CURL_CA_BUNDLE'))
 
         # Merge all the kwargs.
         proxies = merge_setting(proxies, self.proxies)