Skip to content

Commit

Permalink
update example class to ensure value is of corect type
Browse files Browse the repository at this point in the history
  • Loading branch information
jayg-ts committed May 31, 2019
1 parent 3932d80 commit 84d685c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ integers::
elif value[:1] == '0':
return int(value, 8)
return int(value, 10)
except TypeError:
self.fail('expected string for int() conversion, got %s of type %s'
% (value, type(value).__name__), param, ctx)
except ValueError:
self.fail('%s is not a valid integer' % value, param, ctx)

Expand Down

0 comments on commit 84d685c

Please sign in to comment.