Nit but ValueError seems more appropriate here.

https://docs.python.org/2/library/exceptions.html#bltin-exceptions