mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-26 20:59:27 +01:00
Updated PositiveInteger.
This commit is contained in:
parent
a8c3d67cfc
commit
9ce0e7dc7d
@ -117,10 +117,12 @@ class Integer(Value):
|
||||
class PositiveInteger(Value):
|
||||
def set(self, s):
|
||||
try:
|
||||
original = self.value
|
||||
self.value = int(s)
|
||||
if self.value < 0:
|
||||
raise InvalidRegistryValue, 'Value must be a positive integer.'
|
||||
raise ValueError
|
||||
except ValueError:
|
||||
self.value = original
|
||||
raise InvalidRegistryValue, 'Value must be a positive integer.'
|
||||
|
||||
class Float(Value):
|
||||
|
Loading…
Reference in New Issue
Block a user