diff options
-rw-r--r-- | cryptography/fernet.py | 1 | ||||
-rw-r--r-- | tests/test_fernet.py | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/cryptography/fernet.py b/cryptography/fernet.py index 6bc401de..4f98feec 100644 --- a/cryptography/fernet.py +++ b/cryptography/fernet.py @@ -131,6 +131,7 @@ class Fernet(object): class MultiFernet(object): def __init__(self, fernets): + fernets = list(fernets) if not fernets: raise ValueError( "MultiFernet requires at least one Fernet instance" diff --git a/tests/test_fernet.py b/tests/test_fernet.py index 91af32ad..58f89cbf 100644 --- a/tests/test_fernet.py +++ b/tests/test_fernet.py @@ -146,3 +146,7 @@ class TestMultiFernet(object): def test_no_fernets(self, backend): with pytest.raises(ValueError): MultiFernet([]) + + def test_non_iterable_argument(self, backend): + with pytest.raises(TypeError): + MultiFernet(None) |