Skip to content

Commit f818619

Browse files
committed
fix tests
1 parent a608ff8 commit f818619

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Lib/hmac.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,10 @@ def copy(self):
129129
other.digest_size = self.digest_size
130130
if self._hmac:
131131
other._hmac = self._hmac.copy()
132-
other._inner = other._outer = None
132+
if hasattr(self, '_inner'):
133+
del other._inner
134+
if hasattr(other, '_outer'):
135+
del other._outer
133136
else:
134137
other._hmac = None
135138
other._inner = self._inner.copy()

Lib/test/test_hmac.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ def test_realcopy(self):
990990
class OpenSSLCopyTestCase(ExtensionCopyTestCase, unittest.TestCase):
991991

992992
def init(self, h):
993-
h._init_openssl_hmac(b"key", b"msg", digestmod="sha256")
993+
h._init_hmac(b"key", b"msg", digestmod="sha256")
994994

995995

996996
class CompareDigestMixin:

0 commit comments

Comments
 (0)