We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8af7cc4 commit 31f10ceCopy full SHA for 31f10ce
1 file changed
kafka/protocol/new/data_container.py
@@ -24,6 +24,8 @@ def __init_subclass__(cls, **kwargs):
24
25
def __init__(self, *args, version=None, **field_vals):
26
assert self._struct is not None
27
+ if version is not None and not self._struct.min_version <= version <= self._struct.max_version:
28
+ raise ValueError(f'Invalid version: {version} (min={self._struct.min_version}, max={self._struct.max_version})')
29
self._version = version
30
# Support positional arg init for convenience
31
if len(args) > 0:
0 commit comments