Fix mypy warning

CURA-6665
This commit is contained in:
Nino van Hooff 2019-10-23 15:29:54 +02:00
parent 08b1e0e9a8
commit 5436e68ea4

View file

@ -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)