fhdl: fix implicit slice index

This commit is contained in:
Sebastien Bourdeauducq 2011-12-07 22:21:30 +01:00
parent 82f77180d5
commit fab02f84cb
1 changed files with 2 additions and 0 deletions

View File

@ -72,6 +72,8 @@ class Value:
elif isinstance(key, slice):
start = key.start or 0
stop = key.stop or self.bv.width
if stop > self.bv.width:
stop = self.bv.width
if key.step != None:
raise KeyError
return Slice(self, start, stop)