mirror of
https://github.com/SELinuxProject/setools
synced 2025-03-11 07:18:15 +00:00
CriteriaDescriptor: Fix typing for enum_class keyword parameter.
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
This commit is contained in:
parent
ee21412234
commit
f1e0035029
@ -18,7 +18,7 @@ from abc import ABC, abstractmethod
|
|||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from collections.abc import Collection
|
from collections.abc import Collection
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import Any, Callable, MutableMapping, Optional, Union
|
from typing import Any, Callable, MutableMapping, Optional, Type, Union
|
||||||
from weakref import WeakKeyDictionary
|
from weakref import WeakKeyDictionary
|
||||||
|
|
||||||
from .util import validate_perms_any
|
from .util import validate_perms_any
|
||||||
@ -57,7 +57,7 @@ class CriteriaDescriptor:
|
|||||||
|
|
||||||
def __init__(self, name_regex: Optional[str] = None,
|
def __init__(self, name_regex: Optional[str] = None,
|
||||||
lookup_function: Optional[Union[Callable, str]] = None,
|
lookup_function: Optional[Union[Callable, str]] = None,
|
||||||
default_value=None, enum_class: Optional[Enum] = None) -> None:
|
default_value=None, enum_class: Optional[Type[Enum]] = None) -> None:
|
||||||
|
|
||||||
assert name_regex or lookup_function or enum_class, \
|
assert name_regex or lookup_function or enum_class, \
|
||||||
"A simple attribute should be used if there is no regex, lookup function, or enum."
|
"A simple attribute should be used if there is no regex, lookup function, or enum."
|
||||||
|
Loading…
Reference in New Issue
Block a user