re-add setuptools resolve vs load workaround (#3150) (#3157)

* re-add setuptools resolve vs load workaround

* add deprecatedin tag so we can find this easier
This commit is contained in:
Alex Gaynor 2016-09-21 22:19:18 -04:00 committed by Paul Kehrer
parent c0ee738a84
commit 6bef6b471a

View file

@ -17,7 +17,13 @@ def _available_backends():
if _available_backends_list is None:
_available_backends_list = [
ep.resolve()
# DeprecatedIn16
# setuptools 11.3 deprecated support for the require parameter to
# load(), and introduced the new resolve() method instead.
# We previously removed this fallback, but users are having issues
# where Python loads an older setuptools due to various syspath
# weirdness.
ep.resolve() if hasattr(ep, "resolve") else ep.load(require=False)
for ep in pkg_resources.iter_entry_points(
"cryptography.backends"
)