mirror of
https://github.com/JoelBender/bacpypes
synced 2025-10-27 00:57:47 +08:00
a little better parameter type checking, a lot more tests
This commit is contained in:
@@ -356,6 +356,8 @@ class LocalStation(Address):
|
||||
class RemoteStation(Address):
|
||||
|
||||
def __init__(self, net, addr):
|
||||
if not isinstance(net, int):
|
||||
raise TypeError("integer network required")
|
||||
if (net < 0) or (net >= 65535):
|
||||
raise ValueError("network out of range")
|
||||
|
||||
@@ -396,7 +398,9 @@ class LocalBroadcast(Address):
|
||||
|
||||
class RemoteBroadcast(Address):
|
||||
|
||||
def __init__(self,net):
|
||||
def __init__(self, net):
|
||||
if not isinstance(net, int):
|
||||
raise TypeError("integer network required")
|
||||
if (net < 0) or (net >= 65535):
|
||||
raise ValueError("network out of range")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user