diff --git a/cura/Utils/Decorators.py b/cura/Utils/Decorators.py index 52f61eb1f5..9275ee6ce9 100644 --- a/cura/Utils/Decorators.py +++ b/cura/Utils/Decorators.py @@ -3,6 +3,7 @@ import functools import re +from typing import Callable # An API version must be a semantic version "x.y.z" where ".z" is optional. So the valid formats are as follows: # - x.y.z @@ -16,7 +17,7 @@ SEMANTIC_VERSION_REGEX = re.compile(r"^[0-9]+\.[0-9]+(\.[0-9]+)?$") # \param since_version The earliest version since when this API becomes supported. This means that since this version, # this API function is supposed to behave the same. This parameter is not used. It's just a # documentation. -def api(since_version: str) -> callable: +def api(since_version: str) -> Callable: # Make sure that APi versions are semantic versions if not SEMANTIC_VERSION_REGEX.fullmatch(since_version): raise ValueError("API since_version [%s] is not a semantic version." % since_version)