diff options
| author | Jeff Dairiki <dairiki@dairiki.org> | 2015-01-22 11:01:32 -0800 |
|---|---|---|
| committer | Jeff Dairiki <dairiki@dairiki.org> | 2015-02-06 07:40:47 -0800 |
| commit | e30c3b9138605a16386a3e67d233b72cbbcfc5e8 (patch) | |
| tree | ca578b149839e6b111438b21549d69cb55ceab5c | |
| parent | 803ea0bf2d2c2d0354cc5d89fe627bc87c326081 (diff) | |
| download | pyramid-e30c3b9138605a16386a3e67d233b72cbbcfc5e8.tar.gz pyramid-e30c3b9138605a16386a3e67d233b72cbbcfc5e8.tar.bz2 pyramid-e30c3b9138605a16386a3e67d233b72cbbcfc5e8.zip | |
Prevent DeprecationWarning from setuptools>=11.3
| -rw-r--r-- | CHANGES.txt | 3 | ||||
| -rw-r--r-- | pyramid/path.py | 9 |
2 files changed, 10 insertions, 2 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index b334f5258..a7138db1a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -125,6 +125,9 @@ Bug Fixes callback and thus behave just like the ``pyramid.renderers.JSON` renderer. See https://github.com/Pylons/pyramid/pull/1561 +- Prevent "parameters to load are deprecated" ``DeprecationWarning`` + from setuptools>=11.3. + Deprecations ------------ diff --git a/pyramid/path.py b/pyramid/path.py index 470e766f8..8eecc282b 100644 --- a/pyramid/path.py +++ b/pyramid/path.py @@ -337,8 +337,13 @@ class DottedNameResolver(Resolver): value = package.__name__ else: value = package.__name__ + value - return pkg_resources.EntryPoint.parse( - 'x=%s' % value).load(False) + # Calling EntryPoint.load with an argument is deprecated. + # See https://pythonhosted.org/setuptools/history.html#id8 + ep = pkg_resources.EntryPoint.parse('x=%s' % value) + if hasattr(ep, 'resolve'): + return ep.resolve() # setuptools>=10.2 + else: + return ep.load(False) def _zope_dottedname_style(self, value, package): """ package.module.attr style """ |
