diff options
author | Chris Dent <chris.dent@gmail.com> | 2018-11-21 20:29:27 +0000 |
---|---|---|
committer | Chris Dent <chris.dent@gmail.com> | 2018-11-21 20:29:27 +0000 |
commit | 7b5a71096c7a2815d46d05db9ce3cdc4d88d2fbb (patch) | |
tree | 41951f09e7950158167275921a5fbf31bc5ca2bf | |
parent | a2a041b7da2850c82df195ab36450a8aee8129b5 (diff) | |
parent | 053aae54caabfa5d956fb7d6bab65d2e071597c9 (diff) | |
download | pastedeploy-git-7b5a71096c7a2815d46d05db9ce3cdc4d88d2fbb.tar.gz |
Merged in tim-burke/pastedeploy (pull request #13)
Fix string-formatting args when raising LookupError
-rw-r--r-- | paste/deploy/loadwsgi.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/paste/deploy/loadwsgi.py b/paste/deploy/loadwsgi.py index da7c80b..9f3dd0e 100644 --- a/paste/deploy/loadwsgi.py +++ b/paste/deploy/loadwsgi.py @@ -19,7 +19,13 @@ __all__ = ['loadapp', 'loadserver', 'loadfilter', 'appconfig'] def import_string(s): - return pkg_resources.EntryPoint.parse("x=" + s).load(False) + ep = pkg_resources.EntryPoint.parse("x=" + s) + if hasattr(ep, 'resolve'): + # this is available on setuptools >= 10.2 + return ep.resolve() + else: + # this causes a DeprecationWarning on setuptools >= 11.3 + return ep.load(False) def _aslist(obj): |