Skip to content

Commit 70cb4d9

Browse files
committed
create shallow copies using slicing
1 parent 366d889 commit 70cb4d9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/cryptojwt/key_bundle.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Implementation of a Key Bundle."""
2+
23
import copy
34
import json
45
import logging
@@ -580,7 +581,7 @@ def get(self, typ="", only_active=True):
580581
_typs = [typ.lower(), typ.upper()]
581582
_keys = [k for k in self._keys if k.kty in _typs]
582583
else:
583-
_keys = copy.copy(self._keys)
584+
_keys = self._keys[:]
584585

585586
if only_active:
586587
return [k for k in _keys if not k.inactive_since]
@@ -596,7 +597,7 @@ def keys(self, update: bool = True):
596597
if update:
597598
self._uptodate()
598599
with self._lock_reader:
599-
return copy.copy(self._keys)
600+
return self._keys[:]
600601

601602
def active_keys(self):
602603
"""Return the set of active keys."""

0 commit comments

Comments
 (0)