16
16
17
17
# pylint: disable=C0103, W0108, R0915, C0116, C0115
18
18
19
- from __future__ import annotations
20
-
21
19
try :
22
20
from typing import Union
23
21
except ImportError :
@@ -421,7 +419,7 @@ def hexdigest(self) -> str:
421
419
"""
422
420
return "" .join (["%.2x" % i for i in self .digest ()])
423
421
424
- def copy (self ) -> sha256 :
422
+ def copy (self ) -> " sha256" :
425
423
"""Return a copy (“clone”) of the hash object."""
426
424
new = sha256 ()
427
425
new ._sha = self ._sha .copy ()
@@ -495,7 +493,7 @@ def update(self, msg: Union[bytes, bytearray]) -> None:
495
493
"""Update this hashing object with the string msg."""
496
494
self .inner .update (msg )
497
495
498
- def copy (self ) -> HMAC :
496
+ def copy (self ) -> " HMAC" :
499
497
"""Return a separate copy of this hashing object.
500
498
501
499
An update to this copy won't affect the original object.
@@ -508,7 +506,7 @@ def copy(self) -> HMAC:
508
506
other .outer = self .outer .copy ()
509
507
return other
510
508
511
- def _current (self ) -> sha256 :
509
+ def _current (self ) -> " sha256" :
512
510
"""Return a hash object for the current state.
513
511
514
512
To be used only internally with digest() and hexdigest().
@@ -533,7 +531,9 @@ def hexdigest(self) -> str:
533
531
return hmac .hexdigest ()
534
532
535
533
536
- def new_hmac (key : Union [bytes , bytearray ], msg : Union [bytes , bytearray ] = None ) -> HMAC :
534
+ def new_hmac (
535
+ key : Union [bytes , bytearray ], msg : Union [bytes , bytearray ] = None
536
+ ) -> "HMAC" :
537
537
"""Create a new hashing object and return it.
538
538
539
539
key: The starting key for the hash.
0 commit comments