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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user