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