summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Petrov <shazow@gmail.com>2015-04-28 12:07:24 -0400
committerAndrey Petrov <shazow@gmail.com>2015-04-28 12:07:24 -0400
commit51ff447eeffddc03203bdde0932f3183890c6e4c (patch)
tree1ab64233bff4c00b62f36f35b9935fc5611b41a2
parent98a4af2223cdcca0c9e491ac0fa94c33d127706a (diff)
parentf9d426b65e8d2d8a663a844801b9574dcba7cd01 (diff)
downloadurllib3-51ff447eeffddc03203bdde0932f3183890c6e4c.tar.gz
Merge pull request #603 from tlynn/master
Fix #602: don't override existing warning config at import.
-rw-r--r--CONTRIBUTORS.txt3
-rw-r--r--urllib3/__init__.py5
2 files changed, 6 insertions, 2 deletions
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
index 4a7f70a2..58073075 100644
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -145,6 +145,9 @@ In chronological order:
* Tomas Tomecek <ttomecek@redhat.com>
* Implemented generator for getting chunks from chunked responses.
+* tlynn <https://github.com/tlynn>
+ * Respect the warning preferences at import.
+
* [Your name or handle] <[email or website]>
* [Brief summary of your changes]
diff --git a/urllib3/__init__.py b/urllib3/__init__.py
index 8cd51444..cf83d7dd 100644
--- a/urllib3/__init__.py
+++ b/urllib3/__init__.py
@@ -57,9 +57,10 @@ del NullHandler
import warnings
# SecurityWarning's always go off by default.
-warnings.simplefilter('always', exceptions.SecurityWarning)
+warnings.simplefilter('always', exceptions.SecurityWarning, append=True)
# InsecurePlatformWarning's don't vary between requests, so we keep it default.
-warnings.simplefilter('default', exceptions.InsecurePlatformWarning)
+warnings.simplefilter('default', exceptions.InsecurePlatformWarning,
+ append=True)
def disable_warnings(category=exceptions.HTTPWarning):
"""