1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

python: Remove ‘typing.Final’

This is only present in Python 3.8 and above.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15575

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit d6fe66ddeeb99c550fa9a0f1abb845e6daf71f8a)

Autobuild-User(v4-20-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-20-test): Mon Feb 19 15:35:39 UTC 2024 on atb-devel-224
This commit is contained in:
Jo Sutton 2024-02-02 12:23:58 +13:00 committed by Jule Anger
parent 9366f55486
commit 22e56d9ea2
2 changed files with 10 additions and 10 deletions

View File

@ -20,7 +20,7 @@
from enum import Enum
from functools import total_ordering
from typing import Final, Optional, Tuple
from typing import Optional, Tuple
from cryptography.hazmat.primitives import hashes
@ -30,14 +30,14 @@ from samba.ndr import ndr_pack, ndr_unpack
from samba.nt_time import NtTime, NtTimeDelta
uint64_max: Final[int] = 2**64 - 1
uint64_max: int = 2**64 - 1
L1_KEY_ITERATION: Final[int] = _glue.GKDI_L1_KEY_ITERATION
L2_KEY_ITERATION: Final[int] = _glue.GKDI_L2_KEY_ITERATION
KEY_CYCLE_DURATION: Final[NtTimeDelta] = _glue.GKDI_KEY_CYCLE_DURATION
MAX_CLOCK_SKEW: Final[NtTimeDelta] = _glue.GKDI_MAX_CLOCK_SKEW
L1_KEY_ITERATION: int = _glue.GKDI_L1_KEY_ITERATION
L2_KEY_ITERATION: int = _glue.GKDI_L2_KEY_ITERATION
KEY_CYCLE_DURATION: NtTimeDelta = _glue.GKDI_KEY_CYCLE_DURATION
MAX_CLOCK_SKEW: NtTimeDelta = _glue.GKDI_MAX_CLOCK_SKEW
KEY_LEN_BYTES: Final = 64
KEY_LEN_BYTES = 64
class Algorithm(Enum):
@ -107,7 +107,7 @@ class UndefinedStartTime(Exception):
class Gkid:
__slots__ = ["_l0_idx", "_l1_idx", "_l2_idx"]
max_l0_idx: Final = 0x7FFF_FFFF
max_l0_idx = 0x7FFF_FFFF
def __init__(self, l0_idx: int, l1_idx: int, l2_idx: int) -> None:
if not -1 <= l0_idx <= Gkid.max_l0_idx:

View File

@ -25,7 +25,7 @@ os.environ["PYTHONUNBUFFERED"] = "1"
import datetime
import secrets
from typing import Final, NewType, Optional, Tuple, Union
from typing import NewType, Optional, Tuple, Union
import ldb
@ -72,7 +72,7 @@ HResult = NewType("HResult", int)
RootKey = NewType("RootKey", ldb.Message)
ROOT_KEY_START_TIME: Final = NtTime(KEY_CYCLE_DURATION + MAX_CLOCK_SKEW)
ROOT_KEY_START_TIME = NtTime(KEY_CYCLE_DURATION + MAX_CLOCK_SKEW)
class GetKeyError(Exception):