Skip to content

Commit

Permalink
Refs #4399. Managed to alter the wrong copy of validators.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
martyngigg committed Mar 5, 2012
1 parent 4d4f603 commit 7134361
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ def BoundedValidator(lower = None, upper = None):
raise TypeError("Cannot create a BoundedValidator with both lower and upper limit unset.")

def get_validator_class(value):
from mantid.kernel import BoundedValidator_double, BoundedValidator_int
from mantid.kernel import BoundedValidator_double, BoundedValidator_long
if type(value) == float:
return BoundedValidator_double
elif type(value) == int:
return BoundedValidator_int
return BoundedValidator_long
else:
raise TypeError("Unknown type passed for BoundedValidator: %s" % str(type(value)))
#
Expand All @@ -33,11 +33,11 @@ def get_validator_class(value):
elif lower is not None:
cls = get_validator_class(lower)
validator = cls()
cls.setLower(lower)
validator.setLower(lower)
else:
cls = get_validator_class(upper)
validator = cls()
cls.setUpper(lower)
validator.setUpper(lower)
return validator


0 comments on commit 7134361

Please sign in to comment.