diff options
author | Stephen Finucane <stephen@that.guru> | 2016-11-04 10:44:25 +0000 |
---|---|---|
committer | Stephen Finucane <stephen@that.guru> | 2016-11-04 10:44:25 +0000 |
commit | 053aae54caabfa5d956fb7d6bab65d2e071597c9 (patch) | |
tree | b8f9eb94da66b30c091085d905e6c6432e4e7533 | |
parent | e54fc5df70749556d5353a2391f186842b94fa95 (diff) | |
download | pastedeploy-git-053aae54caabfa5d956fb7d6bab65d2e071597c9.tar.gz |
Resolve deprecation warning
-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 fc766b0..3b0cff9 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): |