1
0
mirror of https://github.com/JoelBender/bacpypes synced 2025-10-27 00:57:47 +08:00

add a little error checking so a 'SequenceOf' doesn't sneek in

This commit is contained in:
Joel Bender
2018-02-14 14:53:12 -05:00
parent edeeeb00df
commit c09adff716
3 changed files with 15 additions and 0 deletions

View File

@@ -156,7 +156,12 @@ class Property:
# keep the arguments
self.identifier = identifier
# check the datatype
self.datatype = datatype
if not issubclass(datatype, (Atomic, Sequence, Choice, Array, List, AnyAtomic)):
raise TypeError("invalid datatype for property: %s" % (identifier,))
self.optional = optional
self.mutable = mutable
self.default = default