Params: Fix an off by one error and a misleading comment.
This commit is contained in:
parent
3c237f44c9
commit
46472279c0
1 changed files with 2 additions and 2 deletions
|
@ -658,7 +658,7 @@ class EthernetAddr(ParamValue):
|
||||||
raise TypeError, 'invalid ethernet address %s' % value
|
raise TypeError, 'invalid ethernet address %s' % value
|
||||||
|
|
||||||
for byte in bytes:
|
for byte in bytes:
|
||||||
if not 0 <= int(byte) <= 256:
|
if not 0 <= int(byte) <= 0xff:
|
||||||
raise TypeError, 'invalid ethernet address %s' % value
|
raise TypeError, 'invalid ethernet address %s' % value
|
||||||
|
|
||||||
self.value = value
|
self.value = value
|
||||||
|
@ -1023,7 +1023,7 @@ class NetworkBandwidth(float,ParamValue):
|
||||||
class MemoryBandwidth(float,ParamValue):
|
class MemoryBandwidth(float,ParamValue):
|
||||||
cxx_type = 'float'
|
cxx_type = 'float'
|
||||||
def __new__(cls, value):
|
def __new__(cls, value):
|
||||||
# we want the number of ticks per byte of data
|
# convert to bytes per second
|
||||||
val = convert.toMemoryBandwidth(value)
|
val = convert.toMemoryBandwidth(value)
|
||||||
return super(cls, MemoryBandwidth).__new__(cls, val)
|
return super(cls, MemoryBandwidth).__new__(cls, val)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue