diff options
author | Donald Stufft <donald@stufft.io> | 2014-12-18 12:29:36 -0500 |
---|---|---|
committer | Donald Stufft <donald@stufft.io> | 2014-12-18 12:29:36 -0500 |
commit | 5df137548ceab35e51a53f12664df130bc8f2a5f (patch) | |
tree | f698976bfc5a3a49db1b9956079625638841cd37 | |
parent | 57e7ab8ebab9981efed9936ca11c939e34d52eec (diff) | |
download | external_python_setuptools-5df137548ceab35e51a53f12664df130bc8f2a5f.tar.gz external_python_setuptools-5df137548ceab35e51a53f12664df130bc8f2a5f.tar.bz2 external_python_setuptools-5df137548ceab35e51a53f12664df130bc8f2a5f.zip |
Silence PEP440Warning by default unless invoking easy_install
-rw-r--r-- | pkg_resources.py | 7 | ||||
-rwxr-xr-x | setuptools/command/easy_install.py | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/pkg_resources.py b/pkg_resources.py index 87fd2782..3a8edca5 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -2932,6 +2932,13 @@ def _mkstemp(*args,**kw): os.open = old_open +# Silence the PEP440Warning by default, so that end users don't get hit by it +# randomly just because they use pkg_resources. We want to append the rule +# because we want earlier uses of filterwarnings to take precedence over this +# one. +warnings.filterwarnings("ignore", category=PEP440Warning, append=True) + + # Set up global resource manager (deliberately not state-saved) _manager = ResourceManager() def _initialize(g): diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 2e00b996..a71a7f36 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -54,9 +54,14 @@ from pkg_resources import ( import pkg_resources +# Turn on PEP440Warnings +warnings.filterwarnings("default", category=pkg_resources.PEP440Warning) + + sys_executable = os.environ.get('__PYVENV_LAUNCHER__', os.path.normpath(sys.executable)) + __all__ = [ 'samefile', 'easy_install', 'PthDistributions', 'extract_wininst_cfg', 'main', 'get_exe_prefixes', |