Skip to content

Commit 60c605b

Browse files
authored
Disallow minor version mismatching until vcap's major version is >= 1 (#36)
1 parent cbd8bd9 commit 60c605b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

vcap/vcap/loading/capsule_loading.py

+11
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,17 @@ def load_capsule_from_bytes(data: bytes,
9191
f"capsule's OpenVisionCapsules required major version is "
9292
f"{major} but this software uses OpenVisionCapsules "
9393
f"{MAJOR_COMPATIBLE_VERSION}.{MINOR_COMPATIBLE_VERSION}.")
94+
elif (MAJOR_COMPATIBLE_VERSION == 0
95+
and minor != MINOR_COMPATIBLE_VERSION):
96+
# Because vcap has not yet reached a 1.0 API, while the major
97+
# version is 0 then minor version will be required to match.
98+
raise IncompatibleCapsuleError(
99+
"The capsule is not compatible with this software. The "
100+
"capsule's OpenVisionCapsules required version is "
101+
f"{major}.{minor}, but this software uses OpenVisionCapsules "
102+
f"{MAJOR_COMPATIBLE_VERSION.MINOR_COMPATIBLE_VERSION}"
103+
)
104+
94105
if minor > MINOR_COMPATIBLE_VERSION:
95106
raise IncompatibleCapsuleError(
96107
f"The capsule requires a version of OpenVisionCapsules "

0 commit comments

Comments
 (0)