[Python-modules-commits] [python-pip] 01/17: Ignore urllib3 DependencyWarnings on socks.

Barry Warsaw barry at moszumanska.debian.org
Fri Jun 17 08:18:39 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 2a0ccff7ac7e9c40ad9cd3c529674d109faf0e6a
Author: Barry Warsaw <barry at python.org>
Date:   Fri Jun 17 09:35:24 2016 +0300

    Ignore urllib3 DependencyWarnings on socks.
    
    Patch-Name: ignore-socks-warnings.patch
---
 pip/__main__.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/pip/__main__.py b/pip/__main__.py
index 5556539..7e30310 100644
--- a/pip/__main__.py
+++ b/pip/__main__.py
@@ -15,5 +15,14 @@ if __package__ == '':
 
 import pip  # noqa
 
+# 2016-06-17 barry at debian.org: urllib3 recently added optional socks support,
+# but it issues a homegrown DependencyWarning if socks can't be imported.  For
+# now I don't want to add socks as a dependency for pip, but allowing the
+# warning to be printed to stderr breaks the DEP-8 tests and is just plain
+# annoying for normal users.  For now, suppress the warning.
+from urllib3.exceptions import DependencyWarning
+import warnings
+warnings.simplefilter('ignore', category=DependencyWarning)
+
 if __name__ == '__main__':
     sys.exit(pip.main())

-- 
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