aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cryptography/hazmat/primitives/hashes.py6
-rw-r--r--tests/hazmat/primitives/test_hashes.py6
2 files changed, 6 insertions, 6 deletions
diff --git a/cryptography/hazmat/primitives/hashes.py b/cryptography/hazmat/primitives/hashes.py
index f85d36a0..adf64d30 100644
--- a/cryptography/hazmat/primitives/hashes.py
+++ b/cryptography/hazmat/primitives/hashes.py
@@ -15,7 +15,7 @@ from __future__ import absolute_import, division, print_function
import six
-from cryptography import exceptions
+from cryptography.exceptions import AlreadyFinalized
from cryptography.hazmat.primitives import interfaces
@@ -39,14 +39,14 @@ class Hash(object):
def update(self, data):
if self._ctx is None:
- raise exceptions.AlreadyFinalized()
+ raise AlreadyFinalized()
if isinstance(data, six.text_type):
raise TypeError("Unicode-objects must be encoded before hashing")
self._ctx.update(data)
def copy(self):
if self._ctx is None:
- raise exceptions.AlreadyFinalized()
+ raise AlreadyFinalized()
return Hash(
self.algorithm, backend=self._backend, ctx=self._ctx.copy()
)
diff --git a/tests/hazmat/primitives/test_hashes.py b/tests/hazmat/primitives/test_hashes.py
index a5c440b8..4c644603 100644
--- a/tests/hazmat/primitives/test_hashes.py
+++ b/tests/hazmat/primitives/test_hashes.py
@@ -19,7 +19,7 @@ import pytest
import six
-from cryptography import exceptions
+from cryptography.exceptions import AlreadyFinalized
from cryptography.hazmat.bindings import _default_backend
from cryptography.hazmat.primitives import hashes
@@ -56,10 +56,10 @@ class TestHashContext(object):
h = hashes.Hash(hashes.SHA1())
h.finalize()
- with pytest.raises(exceptions.AlreadyFinalized):
+ with pytest.raises(AlreadyFinalized):
h.update(b"foo")
- with pytest.raises(exceptions.AlreadyFinalized):
+ with pytest.raises(AlreadyFinalized):
h.copy()