[Python-modules-commits] [python-pip] 15/17: Suppress urllib3 socks dependency warnings.
Barry Warsaw
barry at moszumanska.debian.org
Fri Jun 17 08:18:41 UTC 2016
This is an automated email from the git hooks/post-receive script.
barry pushed a commit to branch master
in repository python-pip.
commit de20a722f0a3aab9ece68376cc905fbd5f9b5055
Author: Barry Warsaw <barry at python.org>
Date: Fri Jun 17 10:11:10 2016 +0300
Suppress urllib3 socks dependency warnings.
Patch-Name: ignore-socks-warnings.patch
---
pip/__init__.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/pip/__init__.py b/pip/__init__.py
index 588c881..16e9fdd 100755
--- a/pip/__init__.py
+++ b/pip/__init__.py
@@ -10,6 +10,18 @@ import warnings
import sys
import re
+# 2016-06-17 barry at debian.org: urllib3 1.14 added optional support for socks,
+# but if invoked (i.e. imported), it will issue a warning to stderr if socks
+# isn't available. requests unconditionally imports urllib3's socks contrib
+# module, triggering this warning. The warning breaks DEP-8 tests (because of
+# the stderr output) and is just plain annoying in normal usage. I don't want
+# to add socks as yet another dependency for pip, nor do I want to allow-stder
+# in the DEP-8 tests, so just suppress the warning. pdb tells me this has to
+# be done before the import of pip.vcs.
+from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
+warnings.filterwarnings('ignore', category=DependencyWarning)
+
+
from pip.exceptions import InstallationError, CommandError, PipError
from pip.utils import get_installed_distributions, get_prog
from pip.utils import deprecation, dist_is_editable
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-pip.git
More information about the Python-modules-commits
mailing list