Skip to content

Commit 331dfa0

Browse files
Remove need to import from future module
1 parent b1e9dad commit 331dfa0

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

adafruit_azureiot/hmac.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
# pylint: disable=C0103, W0108, R0915, C0116, C0115
1818

19-
from __future__ import annotations
20-
2119
try:
2220
from typing import Union
2321
except ImportError:
@@ -421,7 +419,7 @@ def hexdigest(self) -> str:
421419
"""
422420
return "".join(["%.2x" % i for i in self.digest()])
423421

424-
def copy(self) -> sha256:
422+
def copy(self) -> "sha256":
425423
"""Return a copy (“clone”) of the hash object."""
426424
new = sha256()
427425
new._sha = self._sha.copy()
@@ -495,7 +493,7 @@ def update(self, msg: Union[bytes, bytearray]) -> None:
495493
"""Update this hashing object with the string msg."""
496494
self.inner.update(msg)
497495

498-
def copy(self) -> HMAC:
496+
def copy(self) -> "HMAC":
499497
"""Return a separate copy of this hashing object.
500498
501499
An update to this copy won't affect the original object.
@@ -508,7 +506,7 @@ def copy(self) -> HMAC:
508506
other.outer = self.outer.copy()
509507
return other
510508

511-
def _current(self) -> sha256:
509+
def _current(self) -> "sha256":
512510
"""Return a hash object for the current state.
513511
514512
To be used only internally with digest() and hexdigest().
@@ -533,7 +531,9 @@ def hexdigest(self) -> str:
533531
return hmac.hexdigest()
534532

535533

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":
537537
"""Create a new hashing object and return it.
538538
539539
key: The starting key for the hash.

adafruit_azureiot/quote.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
1313
"""
1414

15-
from __future__ import annotations
16-
1715
try:
1816
from typing import Any, Union
1917
except ImportError:
@@ -77,7 +75,7 @@ class defaultdict:
7775

7876
@staticmethod
7977
# pylint: disable=W0613
80-
def __new__(cls, default_factory: Any = None, **kwargs: Any) -> defaultdict:
78+
def __new__(cls, default_factory: Any = None, **kwargs: Any) -> "defaultdict":
8179
self = super(defaultdict, cls).__new__(cls)
8280
# pylint: disable=C0103
8381
self.d = {}

0 commit comments

Comments
 (0)