aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2016-03-12 08:13:07 -0500
committerAlex Gaynor <alex.gaynor@gmail.com>2016-03-12 08:13:07 -0500
commit139b85fcd15e846c16ed027d8402422a729d2b07 (patch)
treec98f2dc437d84079a0d7d1c1833fa4af82d0fd1c /src
parent5c66c183913b1f94930100bd0543b8533584a761 (diff)
parent6c439aa5aadfa20e30dfd6172ac533d1891ddce8 (diff)
downloadcryptography-139b85fcd15e846c16ed027d8402422a729d2b07.tar.gz
cryptography-139b85fcd15e846c16ed027d8402422a729d2b07.tar.bz2
cryptography-139b85fcd15e846c16ed027d8402422a729d2b07.zip
Merge pull request #2812 from reaperhulk/fix-2717
make multibackend error with an empty list.
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/hazmat/backends/multibackend.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cryptography/hazmat/backends/multibackend.py b/src/cryptography/hazmat/backends/multibackend.py
index 65f18531..48bc7d08 100644
--- a/src/cryptography/hazmat/backends/multibackend.py
+++ b/src/cryptography/hazmat/backends/multibackend.py
@@ -28,6 +28,13 @@ class MultiBackend(object):
name = "multibackend"
def __init__(self, backends):
+ if len(backends) == 0:
+ raise ValueError(
+ "Multibackend cannot be initialized with no backends. If you "
+ "are seeing this error when trying to use default_backend() "
+ "please try uninstalling and reinstalling cryptography."
+ )
+
self._backends = backends
def _filtered_backends(self, interface):