Skip to content

Commit 6bf98b2

Browse files
authored
Merge pull request #32 from bbc2/fix-deprecated
Avoid use of deprecated `abstractproperty`
2 parents c7ba61c + 12a2a72 commit 6bf98b2

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/shuffled/crypto.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import math
2-
from abc import ABC, abstractmethod, abstractproperty
2+
from abc import ABC, abstractmethod
33
from typing import Sequence
44

55
from cryptography.hazmat.backends import default_backend
@@ -9,15 +9,18 @@
99

1010

1111
class Randomizer(ABC):
12-
@abstractproperty
12+
@property
13+
@abstractmethod
1314
def domain_size(self) -> int: ...
1415

1516
@abstractmethod
1617
def randomize(self, integer: int) -> int: ...
1718

1819

1920
class AesRandomizer(Randomizer):
20-
domain_size = 2**128
21+
@property
22+
def domain_size(self) -> int:
23+
return 2**128
2124

2225
def __init__(self, key: bytes) -> None:
2326
cipher = Cipher(algorithms.AES(key), modes.ECB(), backend=default_backend())

0 commit comments

Comments
 (0)