Skip to content

Commit aca4a7e

Browse files
committed
Revert "refactor to use dict union, instead of unpacking"
This reverts commit eb6d82f. The change itself was fine but since the code is otherwise compatible with python 3.8, let's revert this to be compatible for one more release.
1 parent 1d81a04 commit aca4a7e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tuf/api/_payload.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -346,17 +346,19 @@ def verified(self) -> bool:
346346
def signed(self) -> dict[str, Key]:
347347
"""Dictionary of all signing keys that have signed, from both
348348
VerificationResults.
349-
return a union of all signed.
349+
return a union of all signed (in python<3.9 this requires
350+
dict unpacking)
350351
"""
351-
return self.first.signed | self.second.signed
352+
return {**self.first.signed, **self.second.signed}
352353

353354
@property
354355
def unsigned(self) -> dict[str, Key]:
355356
"""Dictionary of all signing keys that have not signed, from both
356357
VerificationResults.
357-
return a union of all unsigned.
358+
return a union of all unsigned (in python<3.9 this requires
359+
dict unpacking)
358360
"""
359-
return self.first.unsigned | self.second.unsigned
361+
return {**self.first.unsigned, **self.second.unsigned}
360362

361363

362364
class _DelegatorMixin(metaclass=abc.ABCMeta):

0 commit comments

Comments
 (0)