Skip to content

Commit

Permalink
Merge pull request Pylons#1541 from dairiki/bug.load-arg-deprecated
Browse files Browse the repository at this point in the history
Prevent DeprecationWarning from setuptools>=11.3
  • Loading branch information
mmerickel committed Feb 6, 2015
2 parents 803ea0b + b5c0ea4 commit 30608bc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
------------

Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -240,3 +240,5 @@ Contributors
- Adrian Teng, 2014/12/17

- Ilja Everila, 2015/02/05

- Geoffrey T. Dairiki, 2015/02/06
10 changes: 8 additions & 2 deletions pyramid/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,14 @@ def _pkg_resources_style(self, value, package):
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 """
Expand Down

0 comments on commit 30608bc

Please sign in to comment.