From e6fc94d63e650debd759280565b9a7edea2818ff Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Thu, 8 Jan 2015 12:34:47 -0800 Subject: Fixed #1614 -- don't cause warnings with the latest setuptools --- src/cryptography/hazmat/backends/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/cryptography/hazmat/backends/__init__.py b/src/cryptography/hazmat/backends/__init__.py index 24c029f6..2098aeb2 100644 --- a/src/cryptography/hazmat/backends/__init__.py +++ b/src/cryptography/hazmat/backends/__init__.py @@ -17,8 +17,8 @@ def _available_backends(): if _available_backends_list is None: _available_backends_list = [ - backend.load(require=False) - for backend in pkg_resources.iter_entry_points( + ep.resolve() if hasattr(ep, "resolve") else ep.load(require=False) + for ep in pkg_resources.iter_entry_points( "cryptography.backends" ) ] -- cgit v1.2.3 From d334e2f4c7507bb01369e5fc834163aabf1d46d6 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Thu, 8 Jan 2015 13:23:39 -0800 Subject: Added a comment --- src/cryptography/hazmat/backends/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/cryptography/hazmat/backends/__init__.py b/src/cryptography/hazmat/backends/__init__.py index 2098aeb2..d8438248 100644 --- a/src/cryptography/hazmat/backends/__init__.py +++ b/src/cryptography/hazmat/backends/__init__.py @@ -17,6 +17,11 @@ def _available_backends(): if _available_backends_list is None: _available_backends_list = [ + # setuptools 11.3 deprecated support for the require parameter to + # load(), and introduced the new resolve() method instead. + # This can be removed if/when we can assume setuptools>=11.3. At + # some point we may wish to add a warning, to push people along, but + # at present this would result it too many warnings. ep.resolve() if hasattr(ep, "resolve") else ep.load(require=False) for ep in pkg_resources.iter_entry_points( "cryptography.backends" -- cgit v1.2.3 From f8da8e20f0d0265a4f4465eef1294ee59f3edb0e Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Thu, 8 Jan 2015 13:30:51 -0800 Subject: Line length and typo --- src/cryptography/hazmat/backends/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/cryptography/hazmat/backends/__init__.py b/src/cryptography/hazmat/backends/__init__.py index d8438248..256fee39 100644 --- a/src/cryptography/hazmat/backends/__init__.py +++ b/src/cryptography/hazmat/backends/__init__.py @@ -20,8 +20,8 @@ def _available_backends(): # setuptools 11.3 deprecated support for the require parameter to # load(), and introduced the new resolve() method instead. # This can be removed if/when we can assume setuptools>=11.3. At - # some point we may wish to add a warning, to push people along, but - # at present this would result it too many warnings. + # some point we may wish to add a warning, to push people along, + # but at present this would result in too many warnings. ep.resolve() if hasattr(ep, "resolve") else ep.load(require=False) for ep in pkg_resources.iter_entry_points( "cryptography.backends" -- cgit v1.2.3