You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@steve.apache.org by hu...@apache.org on 2019/04/01 15:57:53 UTC

svn commit: r1856749 - /steve/trunk/pysteve/lib/plugins/stv.py

Author: humbedooh
Date: Mon Apr  1 15:57:53 2019
New Revision: 1856749

URL: http://svn.apache.org/viewvc?rev=1856749&view=rev
Log:
Return candidates on short-circuitings (seats >= candidates or seats <= 0) or we risk a NoneType error with a blank result.

Modified:
    steve/trunk/pysteve/lib/plugins/stv.py

Modified: steve/trunk/pysteve/lib/plugins/stv.py
URL: http://svn.apache.org/viewvc/steve/trunk/pysteve/lib/plugins/stv.py?rev=1856749&r1=1856748&r2=1856749&view=diff
==============================================================================
--- steve/trunk/pysteve/lib/plugins/stv.py (original)
+++ steve/trunk/pysteve/lib/plugins/stv.py Mon Apr  1 15:57:53 2019
@@ -70,10 +70,10 @@ def run_vote(names, votes, num_seats):
   if candidates.count(ELECTED + HOPEFUL) <= num_seats:
     debug.append('All candidates elected')
     candidates.change_state(HOPEFUL, ELECTED)
-    return
+    return candidates.retval()
   if num_seats <= 0:
     candidates.change_state(HOPEFUL, ELIMINATED)
-    return
+    return candidates.retval()
 
   quota = None  # not used on first pass
   iteration = 1