Closed GoogleCodeExporter closed 9 years ago
Patch looks correct, of course. I suggest we move this off to a setter. That
way,
we can throw the error closer to where it's happening. If, for example,
somebody
passes in 0 to numSeats in runElection.py, there's no need for us to start the
precount.
Original comment by dan.keshet@gmail.com
on 2 Dec 2009 at 2:14
I committed the patch, but will defer changing the issue status.
Original comment by jlundell
on 2 Dec 2009 at 10:11
Dan, what would you do in the setter if someone tried to do nSeats=0? Would you
raise an exception, set to the minimum acceptable value of 1, or something else?
Original comment by jeff.oneill
on 5 Dec 2009 at 2:56
It's not that big a deal; I'm going to go ahead and mark this as fixed, but
feel free
to reopen if you disagree.
I would throw the same exception in the setter, the same one as is being thrown
in
checkMinRequirements. It would just mean that the exception would be closer to
the
problem. So, if at some later date, there was a bug that accidentally set the
numSeats to an incorrect value, the stacktrace wouldn't come sometime later.
Not *so* important in this case, as most of the time, the numSeats is going to
be set
from the ballots object, so it will already be removed from the exception.
Original comment by dan.keshet@gmail.com
on 6 Dec 2009 at 6:15
Original issue reported on code.google.com by
twoggle@gmail.com
on 2 Dec 2009 at 1:05Attachments: