diff options
| author | Michael Merickel <michael@merickel.org> | 2015-02-06 10:04:24 -0600 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2015-02-06 10:04:24 -0600 |
| commit | 30608bcffa50bee9a37c825c6bd5899a0be3905a (patch) | |
| tree | 07b8c7bcdc101d5ff7fd7e4faed9a7fe12365c1e | |
| parent | 803ea0bf2d2c2d0354cc5d89fe627bc87c326081 (diff) | |
| parent | b5c0ea42424abf400683baf5dbfc2c41cf049ad1 (diff) | |
| download | pyramid-30608bcffa50bee9a37c825c6bd5899a0be3905a.tar.gz pyramid-30608bcffa50bee9a37c825c6bd5899a0be3905a.tar.bz2 pyramid-30608bcffa50bee9a37c825c6bd5899a0be3905a.zip | |
Merge pull request #1541 from dairiki/bug.load-arg-deprecated
Prevent DeprecationWarning from setuptools>=11.3
| -rw-r--r-- | CHANGES.txt | 3 | ||||
| -rw-r--r-- | CONTRIBUTORS.txt | 2 | ||||
| -rw-r--r-- | pyramid/path.py | 10 |
3 files changed, 13 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/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index adf2224a5..319d41434 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -240,3 +240,5 @@ Contributors - Adrian Teng, 2014/12/17 - Ilja Everila, 2015/02/05 + +- Geoffrey T. Dairiki, 2015/02/06 diff --git a/pyramid/path.py b/pyramid/path.py index 470e766f8..f2d8fff55 100644 --- a/pyramid/path.py +++ b/pyramid/path.py @@ -337,8 +337,14 @@ 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'): + # setuptools>=10.2 + return ep.resolve() # pragma: NO COVER + else: + return ep.load(False) # pragma: NO COVER def _zope_dottedname_style(self, value, package): """ package.module.attr style """ |
